From 6d771855ee48890f91094553c31d602347da43b9 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 20 Jun 2026 20:32:15 +0200 Subject: [PATCH] test(a11y): add A4a-A4b photo strip keyboard tests --- tests/ui/accessibility.spec.js | 24 ++++++++++++++++++++++++ user | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/ui/accessibility.spec.js b/tests/ui/accessibility.spec.js index 08ad0ec..f28a2b1 100644 --- a/tests/ui/accessibility.spec.js +++ b/tests/ui/accessibility.spec.js @@ -52,3 +52,27 @@ test('A3d: clicking Stats toggle sets aria-expanded="true" then back to false', await page.click('#trip-stats-toggle'); await expect(page.locator('#trip-stats-toggle')).toHaveAttribute('aria-expanded', 'false'); }); + +// ── A4: Photo strip keyboard navigation ─────────────────────────────────────── +test('A4a: all photo strips have role=region and aria-label', async ({ page }) => { + await page.goto('/trips/japan-korea-2026/dailies'); + const strips = page.locator('.journal-photo-strip'); + const count = await strips.count(); + if (count === 0) return; + for (let i = 0; i < count; i++) { + await expect(strips.nth(i)).toHaveAttribute('role', 'region'); + await expect(strips.nth(i)).toHaveAttribute('aria-label', 'Photo strip'); + } +}); + +test('A4b: multi-slide photo strips have accessible prev/next controls', async ({ page }) => { + await page.goto('/trips/japan-korea-2026/dailies'); + const multiCount = await page.locator('.journal-photo-strip').evaluateAll( + els => els.filter(el => parseInt(el.dataset.slides, 10) >= 2).length + ); + if (multiCount === 0) return; + await expect(page.locator('.strip-prev').first()).toBeAttached(); + await expect(page.locator('.strip-next').first()).toBeAttached(); + await expect(page.locator('.strip-prev').first()).toHaveAttribute('aria-label', 'Previous photo'); + await expect(page.locator('.strip-next').first()).toHaveAttribute('aria-label', 'Next photo'); +}); diff --git a/user b/user index ce5d520..f463ead 160000 --- a/user +++ b/user @@ -1 +1 @@ -Subproject commit ce5d520817e9fed085a4b61c9c2ce86d54ab7474 +Subproject commit f463eadbef25314a0cd0d16e7a526a99c018ef6a