From d13e4dffb8aa46ab970c19911234124a57fadf42 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 20 Jun 2026 20:57:46 +0200 Subject: [PATCH] test(a11y): add A3e-A3f cycling toggle aria-expanded tests (italy-2026-demo) --- tests/ui/accessibility.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/ui/accessibility.spec.js b/tests/ui/accessibility.spec.js index e7314a4..4d8515d 100644 --- a/tests/ui/accessibility.spec.js +++ b/tests/ui/accessibility.spec.js @@ -53,6 +53,22 @@ test('A3d: clicking Stats toggle sets aria-expanded="true" then back to false', await expect(page.locator('#trip-stats-toggle')).toHaveAttribute('aria-expanded', 'false'); }); +const ITALY_URL = '/trips/italy-2026-demo'; + +test('A3e: Cycling toggle has aria-expanded="false" and aria-controls on load', async ({ page }) => { + await page.goto(ITALY_URL); + await expect(page.locator('#trip-cycling-toggle')).toHaveAttribute('aria-expanded', 'false'); + await expect(page.locator('#trip-cycling-toggle')).toHaveAttribute('aria-controls', 'trip-cycling-block'); +}); + +test('A3f: clicking Cycling toggle sets aria-expanded="true" then back to false', async ({ page }) => { + await page.goto(ITALY_URL); + await page.click('#trip-cycling-toggle'); + await expect(page.locator('#trip-cycling-toggle')).toHaveAttribute('aria-expanded', 'true'); + await page.click('#trip-cycling-toggle'); + await expect(page.locator('#trip-cycling-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');