From 49e983e8043fd2a3acc0c256d0db6acd156e028b Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 20 Jun 2026 20:36:48 +0200 Subject: [PATCH] test(a11y): add A5 GPX delete button accessible name test --- tests/ui/accessibility.spec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/ui/accessibility.spec.js b/tests/ui/accessibility.spec.js index f28a2b1..4a7422c 100644 --- a/tests/ui/accessibility.spec.js +++ b/tests/ui/accessibility.spec.js @@ -76,3 +76,22 @@ test('A4b: multi-slide photo strips have accessible prev/next controls', async ( await expect(page.locator('.strip-prev').first()).toHaveAttribute('aria-label', 'Previous photo'); await expect(page.locator('.strip-next').first()).toHaveAttribute('aria-label', 'Next photo'); }); + +// ── A5: GPX delete button unique accessible names ────────────────────────────── +test('A5: GPX delete buttons have unique aria-labels per filename', async ({ page }) => { + await page.route('**/api/v1/pages**/media', async route => { + await route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ + data: [ + { filename: 'tokyo-day1.gpx', size: 102400, modified: '2026-03-25T10:00:00Z' } + ] + }) + }); + }); + await page.goto('/gpx-manager'); + const deleteBtn = page.locator('.gpx-trip').first().locator('.gpx-delete[data-filename="tokyo-day1.gpx"]'); + await expect(deleteBtn).toBeVisible(); + await expect(deleteBtn).toHaveAttribute('aria-label', 'Delete tokyo-day1.gpx'); +});