From 0db4ea9496244e87caeb951a31c20518ef9687e6 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 20 Jun 2026 20:23:05 +0200 Subject: [PATCH] test(a11y): add A2 color contrast token test --- tests/ui/accessibility.spec.js | 11 +++++++++++ user | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/ui/accessibility.spec.js b/tests/ui/accessibility.spec.js index 224a129..9706f85 100644 --- a/tests/ui/accessibility.spec.js +++ b/tests/ui/accessibility.spec.js @@ -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'); +}); diff --git a/user b/user index a7786f2..b1e1a5c 160000 --- a/user +++ b/user @@ -1 +1 @@ -Subproject commit a7786f263fbee59406d2586c6c9610ef228f4484 +Subproject commit b1e1a5cb9a187634918bc24a0b0a273cf4bbd7b1