fix(ui): harden theme toggle accessibility

This commit is contained in:
vince 2026-06-20 00:58:30 +02:00
parent cdb269e505
commit b923ac8947
8 changed files with 75 additions and 9 deletions

View file

@ -240,6 +240,24 @@ test.describe("dashboard page QA gate", () => {
expect(results.violations).toEqual([]);
});
test("passes automated accessibility checks in light mode", async ({
page,
}, testInfo) => {
test.skip(testInfo.project.name !== "chromium-desktop");
await page.goto("/");
await waitForDashboardReady(page);
await page.getByRole("button", { name: "Switch to light theme" }).click();
await expect(page.locator("html")).toHaveAttribute("data-ui-theme", "light");
const results = await new AxeBuilder({ page }).analyze();
expect(results.violations).toEqual([]);
await expect(page).toHaveScreenshot("dashboard-light-desktop.png", {
fullPage: true,
});
});
test("honors reduced-motion preferences", async ({ page }) => {
await page.emulateMedia({ reducedMotion: "reduce" });

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB