test(a11y): add A2 color contrast token test
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
+1
-1
Submodule user updated: a7786f263f...b1e1a5cb9a
Reference in New Issue
Block a user