You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
943 B
TypeScript

// frontend/playwright/dashboard.a11y.spec.ts
import AxeBuilder from "@axe-core/playwright";
import { expect, test } from "@playwright/test";
// color-contrast 제외(레퍼런스 액센트 팔레트) — 구조/시맨틱 WCAG 는 엄격.
const AXE = (page: import("@playwright/test").Page) =>
new AxeBuilder({ page }).withTags(["wcag2a", "wcag2aa"]).disableRules(["color-contrast"]);
test("대시보드 a11y — 라이트", async ({ page }) => {
await page.goto("/dashboard");
await page.getByText("아리 브리핑").waitFor();
expect((await AXE(page).analyze()).violations).toEqual([]);
});
test("대시보드 a11y — 다크", async ({ page }) => {
await page.goto("/dashboard");
await page.getByText("아리 브리핑").waitFor();
await page.getByLabel("테마 전환").click();
await expect(page.locator("html")).toHaveAttribute("data-theme", "dark");
expect((await AXE(page).analyze()).violations).toEqual([]);
});