25 lines
752 B
TypeScript
25 lines
752 B
TypeScript
import AxeBuilder from "@axe-core/playwright";
|
|
|
|
import {
|
|
expect,
|
|
test,
|
|
} from "../support/browser/strict-browser-test.js";
|
|
|
|
test("runs the isolated overlay interaction with blocking accessibility", async ({
|
|
page,
|
|
}) => {
|
|
await page.goto(
|
|
"/iframe.html?id=platform-design-system--overlay-interaction&viewMode=story",
|
|
);
|
|
const trigger = page.getByRole("button", { name: "Open dialog" });
|
|
await expect(trigger).toBeVisible();
|
|
await trigger.click();
|
|
await expect(
|
|
page.getByRole("dialog", { name: "Confirm platform action" }),
|
|
).toBeVisible();
|
|
const results = await new AxeBuilder({ page }).analyze();
|
|
expect(results.violations).toEqual([]);
|
|
await page.keyboard.press("Escape");
|
|
await expect(trigger).toBeFocused();
|
|
});
|