Files
rf4-spotter/apps/web/tests/accessibility.spec.ts
T

11 lines
481 B
TypeScript

import AxeBuilder from "@axe-core/playwright";
import { expect, test } from "@playwright/test";
for (const path of ["/", "/records", "/report"]) {
test(`${path} has no serious accessibility violations`, async ({ page }) => {
await page.goto(path);
const results = await new AxeBuilder({ page }).withTags(["wcag2a", "wcag2aa", "wcag21aa"]).analyze();
expect(results.violations.filter(item => ["critical", "serious"].includes(item.impact ?? ""))).toEqual([]);
});
}