29 lines
986 B
TypeScript
29 lines
986 B
TypeScript
import "@testing-library/jest-dom";
|
|
import * as React from "react";
|
|
import { describe, it } from "vitest";
|
|
|
|
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./dialog";
|
|
import { Button } from "./button";
|
|
import { expectNoAxeViolations } from "@toolctrl/ui-app/test-setup/axe";
|
|
|
|
describe("Dialog axe-core a11y", () => {
|
|
it("open dialog with title + description has no axe violations", async () => {
|
|
await expectNoAxeViolations(
|
|
<Dialog open>
|
|
<DialogTrigger asChild>
|
|
<Button>Open</Button>
|
|
</DialogTrigger>
|
|
<DialogContent>
|
|
<DialogHeader>
|
|
<DialogTitle>Confirm deletion</DialogTitle>
|
|
<DialogDescription>This action cannot be undone.</DialogDescription>
|
|
</DialogHeader>
|
|
<DialogFooter>
|
|
<Button variant="destructive">Delete</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>,
|
|
);
|
|
});
|
|
});
|