import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; import { StatusAlert } from "./status-alert"; describe("StatusAlert", () => { it("renders the info variant with title and children", () => { render( Something to know. , ); expect(screen.getByText("Heads up")).toBeInTheDocument(); expect(screen.getByText("Something to know.")).toBeInTheDocument(); }); it("renders the error variant with title and children", () => { render( Try again. , ); expect(screen.getByText("It broke")).toBeInTheDocument(); expect(screen.getByText("Try again.")).toBeInTheDocument(); }); it("applies descriptionClassName to the description element", () => { render( Body , ); const description = screen .getByText("Body") .closest("[data-slot='alert-description']"); expect(description).toHaveClass("w-full", "gap-3"); }); });