| import { render, screen } from "@testing-library/react"; | |
| import { describe, expect, it } from "vitest"; | |
| import Modal from "./Modal"; | |
| describe("Modal", () => { | |
| it("exposes dialog semantics for assistive technology", () => { | |
| render( | |
| <Modal open title="Review details" onClose={() => {}}> | |
| <div>Body</div> | |
| </Modal> | |
| ); | |
| const dialog = screen.getByRole("dialog", { name: "Review details" }); | |
| expect(dialog).toHaveAttribute("aria-modal", "true"); | |
| }); | |
| }); | |