import { describe, it, expect } from "vitest"; import { render, screen } from "@testing-library/react"; import { Dialog, DialogContent, DialogTitle, DialogDescription } from "./dialog"; function open(className?: string) { render( Title Desc , ); return screen.getByRole("dialog"); } describe("DialogContent centring", () => { it("uses no transform-based centring (no translate class)", () => { expect(open().className).not.toMatch(/translate/); }); it("centres via inset-0 and m-auto", () => { const el = open(); expect(el).toHaveClass("inset-0"); expect(el).toHaveClass("m-auto"); }); it("caller h-[90vh] replaces the default height", () => { const el = open("h-[90vh]"); expect(el).toHaveClass("h-[90vh]"); expect(el).not.toHaveClass("h-fit"); }); });