From dcf885fcf632a433304558845bd3a2c96e2a8a22 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 19 Nov 2024 17:07:47 +0100 Subject: [PATCH] revert componentID --- packages/html-reporter/src/links.tsx | 3 +-- packages/html-reporter/src/testResultView.tsx | 8 +------- packages/html-reporter/src/treeItem.tsx | 5 ++--- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/html-reporter/src/links.tsx b/packages/html-reporter/src/links.tsx index fc2b83ff73..8c1dcc85dc 100644 --- a/packages/html-reporter/src/links.tsx +++ b/packages/html-reporter/src/links.tsx @@ -22,7 +22,6 @@ import { CopyToClipboard } from './copyToClipboard'; import './links.css'; import { linkifyText } from '@web/renderUtils'; import { clsx } from '@web/uiUtils'; -import { componentID } from './testResultView'; export function navigate(href: string) { window.history.pushState({}, '', href); @@ -78,7 +77,7 @@ export const AttachmentLink: React.FunctionComponent<{ linkName?: string, openInNewTab?: boolean, }> = ({ attachment, href, linkName, openInNewTab }) => { - return params.set('attachment', attachment.name))} title={ + return {attachment.contentType === kMissingContentType ? icons.warning() : icons.attachment()} {attachment.path && {linkName || attachment.name}} {!attachment.path && ( diff --git a/packages/html-reporter/src/testResultView.tsx b/packages/html-reporter/src/testResultView.tsx index 84ccbd9ebc..3b81a0ffc6 100644 --- a/packages/html-reporter/src/testResultView.tsx +++ b/packages/html-reporter/src/testResultView.tsx @@ -174,12 +174,6 @@ function classifyErrors(testErrors: string[], diffs: ImageDiff[]) { }); } -export function componentID(cb: (params: URLSearchParams) => void) { - const searchParams = new URLSearchParams(window.location.hash.slice(1)); - cb(searchParams); - return '?' + searchParams; -} - const StepTreeItem: React.FC<{ step: TestStep; depth: number, @@ -187,7 +181,7 @@ const StepTreeItem: React.FC<{ const attachmentName = step.title.match(/^attach "(.*)"$/)?.[1]; return {msToString(step.duration)} - {attachmentName && params.set('attachment', attachmentName))} onClick={evt => { evt.stopPropagation(); }}>{icons.attachment()}} + {attachmentName && { evt.stopPropagation(); }}>{icons.attachment()}} {statusIcon(step.error || step.duration === -1 ? 'failed' : 'passed')} {step.title} {step.count > 1 && <> ✕ {step.count}} diff --git a/packages/html-reporter/src/treeItem.tsx b/packages/html-reporter/src/treeItem.tsx index 735dfc09ae..507a9c0e71 100644 --- a/packages/html-reporter/src/treeItem.tsx +++ b/packages/html-reporter/src/treeItem.tsx @@ -26,11 +26,10 @@ export const TreeItem: React.FunctionComponent<{ depth: number, selected?: boolean, style?: React.CSSProperties, - id?: string, -}> = ({ title, loadChildren, onClick, expandByDefault, depth, selected, style, id }) => { +}> = ({ title, loadChildren, onClick, expandByDefault, depth, selected, style }) => { const [expanded, setExpanded] = React.useState(expandByDefault || false); const className = selected ? 'tree-item-title selected' : 'tree-item-title'; - return
+ return
{ onClick?.(); setExpanded(!expanded); }} > {loadChildren && !!expanded && icons.downArrow()} {loadChildren && !expanded && icons.rightArrow()}