feat(a11y): aria-live narration of scale/clip; hide decorative SVGs
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,3 +78,22 @@ test.describe("Task 6 — Keyboard + ARIA dial", () => {
|
||||
await expect(dial).toHaveAttribute("aria-valuenow", "0");
|
||||
});
|
||||
});
|
||||
|
||||
test.describe("Task 7 — Screen-reader narration", () => {
|
||||
test("an aria-live region narrates the current scale", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
const live = page.locator("#sr-status");
|
||||
await expect(live).toHaveAttribute("aria-live", "polite");
|
||||
await page.locator("#dial").focus();
|
||||
await page.locator("#dial").press("Home");
|
||||
await expect
|
||||
.poll(async () => (await live.textContent())?.toLowerCase())
|
||||
.toContain("cosmos");
|
||||
});
|
||||
|
||||
test("decorative overlay SVGs are hidden from assistive tech", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await expect(page.locator("#overlay")).toHaveAttribute("aria-hidden", "true");
|
||||
await expect(page.locator("#affect")).toHaveAttribute("aria-hidden", "true");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user