27 lines
840 B
TypeScript
27 lines
840 B
TypeScript
import "@testing-library/jest-dom";
|
|
import * as React from "react";
|
|
import { describe, it } from "vitest";
|
|
|
|
import { Alert, AlertDescription, AlertTitle } from "./alert";
|
|
import { expectNoAxeViolations } from "@toolctrl/ui-app/test-setup/axe";
|
|
|
|
describe("Alert axe-core a11y", () => {
|
|
it("info alert has no axe violations", async () => {
|
|
await expectNoAxeViolations(
|
|
<Alert>
|
|
<AlertTitle>Heads up</AlertTitle>
|
|
<AlertDescription>Your subscription renews tomorrow.</AlertDescription>
|
|
</Alert>,
|
|
);
|
|
});
|
|
|
|
it("destructive alert with role=alert has no axe violations", async () => {
|
|
await expectNoAxeViolations(
|
|
<Alert variant="destructive" role="alert">
|
|
<AlertTitle>Error</AlertTitle>
|
|
<AlertDescription>Could not save changes.</AlertDescription>
|
|
</Alert>,
|
|
);
|
|
});
|
|
});
|