diff --git a/apps/frontend/src/pages/Build/BuildDetail.tsx b/apps/frontend/src/pages/Build/BuildDetail.tsx index 38fc7b8aa..368eb6ed2 100644 --- a/apps/frontend/src/pages/Build/BuildDetail.tsx +++ b/apps/frontend/src/pages/Build/BuildDetail.tsx @@ -119,7 +119,17 @@ const MissingScreenshotInfo = memo( }, ); -const getImgAttributes = ({ +function getAspectRatio({ + width, + height, +}: { + width?: number | null | undefined; + height?: number | null | undefined; +}) { + return width && height ? `${width}/${height}` : undefined; +} + +function getImgAttributes({ url, width, height, @@ -127,25 +137,37 @@ const getImgAttributes = ({ url: string; width?: number | null | undefined; height?: number | null | undefined; -}) => { +}) { return { key: url, src: `${url}?tr=lo-true`, - style: { aspectRatio: width && height ? `${width}/${height}` : undefined }, + style: { aspectRatio: getAspectRatio({ width, height }) }, }; -}; +} -const NeutralLink = ({ - href, +function ScreenshotContainer({ + dimensions, + contained, children, }: { - href: string; + dimensions: { + width?: number | null; + height?: number | null; + }; + contained: boolean; children: React.ReactNode; -}) => ( - - {children} - -); +}) { + return ( +
+ {children} +
+ ); +} const BaseScreenshot = ({ diff }: { diff: Diff }) => { const { contained } = useBuildDiffFitState(); @@ -198,11 +220,16 @@ const BaseScreenshot = ({ diff }: { diff: Diff }) => { /> } > - Baseline screenshot + + Baseline screenshot + ); case "changed": @@ -215,19 +242,21 @@ const BaseScreenshot = ({ diff }: { diff: Diff }) => { /> } > - - Baseline screenshot + + + Baseline screenshot + ); default: @@ -250,11 +279,16 @@ const CompareScreenshot = ({ diff }: { diff: Diff }) => { /> } > - Changes screenshot + + Changes screenshot + ); case "failure": @@ -267,11 +301,16 @@ const CompareScreenshot = ({ diff }: { diff: Diff }) => { /> } > - Failure screenshot + + Failure screenshot + ); case "unchanged": @@ -284,13 +323,16 @@ const CompareScreenshot = ({ diff }: { diff: Diff }) => { /> } > - + Baseline screenshot - + ); case "removed": @@ -316,23 +358,28 @@ const CompareScreenshot = ({ diff }: { diff: Diff }) => { /> } > - - Changes screenshot + + + Changes screenshot + ); default: diff --git a/apps/frontend/src/pages/Build/Zoomer.tsx b/apps/frontend/src/pages/Build/Zoomer.tsx index 61f65574d..9c2c662dd 100644 --- a/apps/frontend/src/pages/Build/Zoomer.tsx +++ b/apps/frontend/src/pages/Build/Zoomer.tsx @@ -312,10 +312,10 @@ export const ZoomPane = (props: { >
-
{props.children}
+ {props.children}
{props.controls && (
diff --git a/playwright.config.mjs b/playwright.config.mjs index 307ae60ae..a34dd2df2 100644 --- a/playwright.config.mjs +++ b/playwright.config.mjs @@ -61,6 +61,12 @@ const config = { ...devices["Desktop Chrome"], }, }, + { + name: "firefox", + use: { + ...devices["Desktop Firefox"], + }, + }, ], /* Folder for test artifacts such as screenshots, videos, traces, etc. */