From d67032db96dc7be3b7e3c07d34c494f8ec3fff16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 17 Oct 2026 10:43:59 +0200 Subject: [PATCH] test(e2e): wait for the document title before scanning the handover screens The decision screen is reached by a client navigation, during which the old route's title unmounts and the new one mounts from a suspended metadata boundary that can reveal after the body has painted. Under load the scan ran in that stretch and reported document-title. The helper now asserts the title first, so a screen that never gets one still fails. Refs #959 --- e2e/v142-managed-profile-handover.spec.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/e2e/v142-managed-profile-handover.spec.ts b/e2e/v142-managed-profile-handover.spec.ts index fc722b35e..bfa8a69fc 100644 --- a/e2e/v142-managed-profile-handover.spec.ts +++ b/e2e/v142-managed-profile-handover.spec.ts @@ -30,8 +30,19 @@ function connect(): pg.Pool { return new pg.Pool({ connectionString: url }); } -/** WCAG 2.1 AA on the screen as it stands. */ +/** + * WCAG 2.1 AA on the screen as it stands. + * + * The decision screen is reached by a client navigation, and during one the + * framework unmounts the old route's `` and mounts the new one from a + * suspended metadata boundary, which can reveal after the page body has + * painted. Measured under CPU throttling: the decision is on screen for about + * 200 ms before the title arrives. A scan in that stretch audits the + * navigation, not the screen, so the title is waited for first, and asserted: + * a screen that never gets one still fails here. + */ async function expectNoAxeViolations(page: Page): Promise<void> { + await expect(page).toHaveTitle("HealthLog"); const result = await new AxeBuilder({ page }) .withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]) .analyze();