diff --git a/frontend/e2e/helpers/contrast.ts b/frontend/e2e/helpers/contrast.ts index ed54da58..28ab7a76 100644 --- a/frontend/e2e/helpers/contrast.ts +++ b/frontend/e2e/helpers/contrast.ts @@ -62,6 +62,16 @@ export const mountEditorProbes = async (page: Page, probes: Record { await page.goto(entry.path); await expect(entry.ready(page)).toBeVisible(); + // A seed that stops taking effect would otherwise re-run the light + // theme under a dark label and pass. + await expect(page.locator('html')).toHaveClass(theme === 'dark' ? /dark/ : /light/); await scanA11y(page, entry.path, entry.a11yWaivers); }); }); diff --git a/frontend/e2e/specs/cross/contrast.spec.ts b/frontend/e2e/specs/cross/contrast.spec.ts index 26eda8f2..5c11ff2e 100644 --- a/frontend/e2e/specs/cross/contrast.spec.ts +++ b/frontend/e2e/specs/cross/contrast.spec.ts @@ -42,6 +42,7 @@ for (const theme of THEMES) { test('every badge variant clears AA at rest and on hover', async ({ page }) => { await page.goto('/flows'); await expect(page.getByRole('row', { name: /E2E Alpha/ })).toBeVisible(); + await expect(page.locator('html')).toHaveClass(theme === 'dark' ? /dark/ : /light/); await mountContrastProbes( page, @@ -63,6 +64,7 @@ for (const theme of THEMES) { test('the destructive button clears AA at rest and on hover', async ({ page }) => { await page.goto('/flows'); await expect(page.getByRole('row', { name: /E2E Alpha/ })).toBeVisible(); + await expect(page.locator('html')).toHaveClass(theme === 'dark' ? /dark/ : /light/); await mountContrastProbes(page, { destructive: buttonVariants({ variant: 'destructive' }) }); @@ -77,6 +79,7 @@ for (const theme of THEMES) { test('editor highlight tokens clear AA on the editor surface', async ({ page }) => { await page.goto('/flows'); await expect(page.getByRole('row', { name: /E2E Alpha/ })).toBeVisible(); + await expect(page.locator('html')).toHaveClass(theme === 'dark' ? /dark/ : /light/); await mountEditorProbes(page, EDITOR_TOKENS);