From f401472fb9c4d878750270e2da5910782420968a Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 30 Oct 2026 12:31:01 +0100 Subject: [PATCH 1/6] test(website): dogfood a blog post with a non-ASCII html slug (AI-assisted) Regression test for exact .html routes with encoded characters: the browser URL is /caf%C3%A9.html while the router decodes it. Co-Authored-By: Claude Opus 5.5 --- .../_blog tests/2022-10-02-html-slug-non-ascii.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 website/_dogfooding/_blog tests/2022-10-02-html-slug-non-ascii.mdx diff --git a/website/_dogfooding/_blog tests/2022-10-02-html-slug-non-ascii.mdx b/website/_dogfooding/_blog tests/2022-10-02-html-slug-non-ascii.mdx new file mode 100644 index 000000000000..7659e95ad115 --- /dev/null +++ b/website/_dogfooding/_blog tests/2022-10-02-html-slug-non-ascii.mdx @@ -0,0 +1,11 @@ +--- +title: A post with a non-ASCII html slug +unlisted: true +slug: /x/y/café.html +--- + +# Hmmm! + +This is a blog post with a non-ASCII html slug! + +Opened at `/tests/blog/x/y/café.html`, it should render only once, without hydration error. From d1d9c8491a66e36f81c9c7b78707ec289e10e6a6 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 30 Oct 2026 12:37:18 +0100 Subject: [PATCH 2/6] test(argos): screenshot pages served at .html URLs by static hosts (AI-assisted) docusaurus serve redirects /page.html URLs, so serve the HTML file the way Netlify does to reproduce the duplicate render of the app. Co-Authored-By: Claude Opus 5.5 --- argos/tests/screenshot.spec.ts | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/argos/tests/screenshot.spec.ts b/argos/tests/screenshot.spec.ts index 95e88503a4ae..d1841be08441 100644 --- a/argos/tests/screenshot.spec.ts +++ b/argos/tests/screenshot.spec.ts @@ -11,6 +11,7 @@ import * as cheerio from 'cheerio'; import type {Page} from '@playwright/test'; const siteUrl = 'http://localhost:3000'; +const buildPath = '../website/build'; const sitemapPath = '../website/build/sitemap.xml'; const stylesheetPath = './tests/screenshot.css'; @@ -171,6 +172,45 @@ function createPathnameTest(pathname: string) { }); } +type StaticHostResponse = { + pathname: string; + file: string; + status?: number; +}; + +// docusaurus serve redirects these URLs, but static hosts like Netlify serve +// them, and React can render the page twice +// See https://github.com/facebook/docusaurus/pull/10059 +const StaticHostResponses: StaticHostResponse[] = [ + {pathname: '/tests.html', file: 'tests.html'}, + {pathname: '/tests/index.html', file: '404.html', status: 404}, + { + pathname: '/tests/blog/x/y/caf%C3%A9.html', + file: 'tests/blog/x/y/café.html', + }, +]; + +function createStaticHostResponseTest({ + pathname, + file, + status, +}: StaticHostResponse) { + test(`pathname ${pathname} served with ${file}`, async ({page}) => { + // The 404 page HTML doesn't match the page: React logs a hydration error + if (status !== 404) { + throwOnConsole(page); + } + await page.route( + (url) => url.pathname === pathname, + (route) => route.fulfill({path: `${buildPath}/${file}`, status}), + ); + await page.goto(siteUrl + pathname); + await page.waitForFunction(waitForDocusaurusHydration); + await page.addStyleTag({content: stylesheet}); + await argosScreenshot(page, `static-host/${pathnameToArgosName(pathname)}`); + }); +} + // Allow parallel execution within a single test file // See https://playwright.dev/docs/test-parallel test.describe.configure({mode: 'parallel'}); @@ -179,3 +219,7 @@ test.describe('Docusaurus site screenshots', () => { const pathnames = getPathnames(); pathnames.forEach(createPathnameTest); }); + +test.describe('Docusaurus site screenshots served by static hosts', () => { + StaticHostResponses.forEach(createStaticHostResponseTest); +}); From 8a5a0512aebef5e40aedb9cd94ac6ae5809923f3 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 30 Oct 2026 13:30:59 +0100 Subject: [PATCH 3/6] =?UTF-8?q?test(website):=20use=20a=20dogfood=20doc=20?= =?UTF-8?q?instead=20of=20a=20blog=20post=20for=20the=20caf=C3=A9=20repro?= =?UTF-8?q?=20(AI-assisted)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The blog post appeared in the sidebar of every dogfood blog page in the Argos dev build. Like dummy.html, the doc is in no sidebar. Co-Authored-By: Claude Opus 5.5 --- argos/tests/screenshot.spec.ts | 1 + .../_blog tests/2022-10-02-html-slug-non-ascii.mdx | 11 ----------- .../_dogfooding/_docs tests/html-slug-non-ascii.mdx | 7 +++++++ 3 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 website/_dogfooding/_blog tests/2022-10-02-html-slug-non-ascii.mdx create mode 100644 website/_dogfooding/_docs tests/html-slug-non-ascii.mdx diff --git a/argos/tests/screenshot.spec.ts b/argos/tests/screenshot.spec.ts index 95e88503a4ae..fcc7910a544c 100644 --- a/argos/tests/screenshot.spec.ts +++ b/argos/tests/screenshot.spec.ts @@ -60,6 +60,7 @@ function isBlacklisted(pathname: string) { // Flaky because of hydration error with docusaurus serve + .html '/tests/blog/x/y/z.html', '/tests/docs/dummy.html', + '/tests/docs/caf%C3%A9.html', // Cause weird docusaurus serve errors: '/tests/docs/tests/ascii/%C3%A6%C3%B8%C3%A5', '/tests/docs/tests/ascii/folder/%C3%A6%C3%B8%C3%A5', diff --git a/website/_dogfooding/_blog tests/2022-10-02-html-slug-non-ascii.mdx b/website/_dogfooding/_blog tests/2022-10-02-html-slug-non-ascii.mdx deleted file mode 100644 index 7659e95ad115..000000000000 --- a/website/_dogfooding/_blog tests/2022-10-02-html-slug-non-ascii.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: A post with a non-ASCII html slug -unlisted: true -slug: /x/y/café.html ---- - -# Hmmm! - -This is a blog post with a non-ASCII html slug! - -Opened at `/tests/blog/x/y/café.html`, it should render only once, without hydration error. diff --git a/website/_dogfooding/_docs tests/html-slug-non-ascii.mdx b/website/_dogfooding/_docs tests/html-slug-non-ascii.mdx new file mode 100644 index 000000000000..d2fec12d7860 --- /dev/null +++ b/website/_dogfooding/_docs tests/html-slug-non-ascii.mdx @@ -0,0 +1,7 @@ +--- +slug: café.html +--- + +# Doc with a non-ASCII html slug + +Opened at `/tests/docs/café.html`, it should render without hydration error. From b1242fa39399539bb723f56bdb7e9106427ba493 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 30 Oct 2026 13:31:19 +0100 Subject: [PATCH 4/6] =?UTF-8?q?test(argos):=20screenshot=20the=20caf=C3=A9?= =?UTF-8?q?=20dogfood=20doc=20instead=20of=20the=20blog=20post=20(AI-assis?= =?UTF-8?q?ted)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- argos/tests/screenshot.spec.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/argos/tests/screenshot.spec.ts b/argos/tests/screenshot.spec.ts index b3a8a424a092..d98d50032fb5 100644 --- a/argos/tests/screenshot.spec.ts +++ b/argos/tests/screenshot.spec.ts @@ -185,10 +185,7 @@ type StaticHostResponse = { const StaticHostResponses: StaticHostResponse[] = [ {pathname: '/tests.html', file: 'tests.html'}, {pathname: '/tests/index.html', file: '404.html', status: 404}, - { - pathname: '/tests/blog/x/y/caf%C3%A9.html', - file: 'tests/blog/x/y/café.html', - }, + {pathname: '/tests/docs/caf%C3%A9.html', file: 'tests/docs/café.html'}, ]; function createStaticHostResponseTest({ From d397459cc4afcfe5889551ead450d2379ddb51b5 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 30 Oct 2026 13:45:39 +0100 Subject: [PATCH 5/6] =?UTF-8?q?test(argos):=20move=20the=20caf=C3=A9=20reg?= =?UTF-8?q?ression=20test=20out=20of=20the=20repro=20(AI-assisted)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The café doc works on main: it guards the fix PR against a regression. Co-Authored-By: Claude Opus 5.5 --- argos/tests/screenshot.spec.ts | 2 -- website/_dogfooding/_docs tests/html-slug-non-ascii.mdx | 7 ------- 2 files changed, 9 deletions(-) delete mode 100644 website/_dogfooding/_docs tests/html-slug-non-ascii.mdx diff --git a/argos/tests/screenshot.spec.ts b/argos/tests/screenshot.spec.ts index d98d50032fb5..4419f94730cc 100644 --- a/argos/tests/screenshot.spec.ts +++ b/argos/tests/screenshot.spec.ts @@ -61,7 +61,6 @@ function isBlacklisted(pathname: string) { // Flaky because of hydration error with docusaurus serve + .html '/tests/blog/x/y/z.html', '/tests/docs/dummy.html', - '/tests/docs/caf%C3%A9.html', // Cause weird docusaurus serve errors: '/tests/docs/tests/ascii/%C3%A6%C3%B8%C3%A5', '/tests/docs/tests/ascii/folder/%C3%A6%C3%B8%C3%A5', @@ -185,7 +184,6 @@ type StaticHostResponse = { const StaticHostResponses: StaticHostResponse[] = [ {pathname: '/tests.html', file: 'tests.html'}, {pathname: '/tests/index.html', file: '404.html', status: 404}, - {pathname: '/tests/docs/caf%C3%A9.html', file: 'tests/docs/café.html'}, ]; function createStaticHostResponseTest({ diff --git a/website/_dogfooding/_docs tests/html-slug-non-ascii.mdx b/website/_dogfooding/_docs tests/html-slug-non-ascii.mdx deleted file mode 100644 index d2fec12d7860..000000000000 --- a/website/_dogfooding/_docs tests/html-slug-non-ascii.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -slug: café.html ---- - -# Doc with a non-ASCII html slug - -Opened at `/tests/docs/café.html`, it should render without hydration error. From 053c351fa445da840729c4d20ab42d79c676bea7 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 30 Oct 2026 13:46:09 +0100 Subject: [PATCH 6/6] test(argos): capture the duplicate render in aria snapshots too (AI-assisted) Co-Authored-By: Claude Opus 5.5 --- argos/tests/screenshot.spec.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/argos/tests/screenshot.spec.ts b/argos/tests/screenshot.spec.ts index 4419f94730cc..7e0318ff1ed6 100644 --- a/argos/tests/screenshot.spec.ts +++ b/argos/tests/screenshot.spec.ts @@ -203,7 +203,13 @@ function createStaticHostResponseTest({ await page.goto(siteUrl + pathname); await page.waitForFunction(waitForDocusaurusHydration); await page.addStyleTag({content: stylesheet}); - await argosScreenshot(page, `static-host/${pathnameToArgosName(pathname)}`); + await argosScreenshot( + page, + `static-host/${pathnameToArgosName(pathname)}`, + { + ariaSnapshot: true, + }, + ); }); }