Skip to content

Commit 90f7dd5

Browse files
author
DevBot
committed
fix(www): de-duplicate footer chrome baselines (route-invariant chrome)
The footer is identical across routes for a given locale/theme/viewport, so per-route footer snapshots are byte-identical and fail the exact-duplicate baseline gate (#1230 M15). The footer now owns ONE baseline per locale x theme x viewport (shot on the home route); the docs sidebar keeps its per-route baselines because its section filtering makes each route's chrome distinct. Desktop sidebar baselines were regenerated under the fixed property-contract behavior (claim now succeeds and the island actually hydrates, so the committed pixels reflect the hydrated shell rather than the pre-fix stuck-SSR state).
1 parent ba991cd commit 90f7dd5

25 files changed

Lines changed: 17 additions & 12 deletions

File tree

www/e2e/visual-baselines.spec.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,15 @@ const sharedLocaleBaselines = new Set<string>([]);
6464
// (fullPage: false keeps the baseline stable across long pages and the
6565
// cinematic scroll surfaces), which is exactly how the page-bottom footer
6666
// regression shipped green. Dedicated chrome element snapshots close that
67-
// gap: the footer (every layout class) and the docs sidebar (desktop reading
68-
// layouts) own reviewed baselines without taking on fullPage flakiness.
67+
// gap: the docs sidebar (desktop reading layouts) owns a reviewed baseline
68+
// per reading route — its section filtering makes each route's chrome
69+
// distinct. The footer is route-invariant chrome, so it owns ONE baseline
70+
// per locale x theme x viewport (shot on the home route); per-route footer
71+
// snapshots are byte-identical and fail the exact-duplicate baseline gate.
6972
const chromeRoutes = [
70-
{ route: '/', sidebar: false },
71-
{ route: '/guide/getting-started', sidebar: true },
72-
{ route: '/architecture/dsd', sidebar: true },
73+
{ route: '/', sidebar: false, footer: true },
74+
{ route: '/guide/getting-started', sidebar: true, footer: false },
75+
{ route: '/architecture/dsd', sidebar: true, footer: false },
7376
] as const;
7477

7578
for (const locale of ['en', 'zh'] as const) {
@@ -80,7 +83,7 @@ for (const locale of ['en', 'zh'] as const) {
8083
await page.setViewportSize(viewport);
8184
await page.emulateMedia({ reducedMotion: 'reduce' });
8285
await page.addInitScript((value) => localStorage.setItem('open-theme', value), theme);
83-
for (const { route, sidebar } of chromeRoutes) {
86+
for (const { route, sidebar, footer } of chromeRoutes) {
8487
const localized = locale === 'en'
8588
? route
8689
: route === '/'
@@ -90,12 +93,14 @@ for (const locale of ['en', 'zh'] as const) {
9093
await expect(page.locator('open-layout')).toBeVisible();
9194
const routeName = route === '/' ? 'home' : route.slice(1).replaceAll('/', '-');
9295
const chromeKey = `${locale}-${theme}-${viewport.name}-${routeName}`;
93-
const footer = page.locator('.app-footer');
94-
await footer.scrollIntoViewIfNeeded();
95-
await expect(footer).toHaveScreenshot(`${chromeKey}-footer.png`, {
96-
animations: 'disabled',
97-
caret: 'hide',
98-
});
96+
if (footer) {
97+
const footerLoc = page.locator('.app-footer');
98+
await footerLoc.scrollIntoViewIfNeeded();
99+
await expect(footerLoc).toHaveScreenshot(`${chromeKey}-footer.png`, {
100+
animations: 'disabled',
101+
caret: 'hide',
102+
});
103+
}
99104
// The sidebar is a desktop layout element; mobile collapses it into
100105
// the native disclosure covered semantically by site-chrome.spec.ts.
101106
if (sidebar && viewport.name === 'desktop') {
940 Bytes
Loading
1.19 KB
Loading
880 Bytes
Loading

0 commit comments

Comments
 (0)