test(a11y): add A2 color contrast token test

This commit is contained in:
2026-06-20 20:23:05 +02:00
parent 1e28081b31
commit 0db4ea9496
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -10,3 +10,14 @@ test('A1: skip link targets #main-content and is first focusable element', async
await expect(skipLink).toHaveAttribute('href', '#main-content');
await expect(page.locator('#main-content')).toBeAttached();
});
// ── A2: Color token contrast ───────────────────────────────────────────────────
test('A2: contrast tokens meet WCAG AA 4.5:1 floor', async ({ page }) => {
await page.goto('/');
const [muted, accent] = await page.evaluate(() => [
getComputedStyle(document.documentElement).getPropertyValue('--color-ink-muted').trim(),
getComputedStyle(document.documentElement).getPropertyValue('--color-accent').trim(),
]);
expect(muted.toLowerCase()).toBe('#90887e');
expect(accent.toLowerCase()).toBe('#2e9880');
});