import { describe, it, expect } from "vitest"; import { renderToStaticMarkup } from "react-dom/server"; import { ActivityIcon } from "lucide-react"; import { EmptyState } from "./empty-state"; describe("EmptyState", () => { it("renders the icon, title, and description", () => { const html = renderToStaticMarkup( , ); expect(html).toContain("No activity yet."); expect(html).toContain("Reminder fire events will appear here."); // The lucide icon component renders an with the lucide-activity class. expect(html).toMatch(/]*lucide-activity/); }); it("omits the description when it isn't passed", () => { const html = renderToStaticMarkup( , ); expect(html).toContain("No archived runs."); // No second

element for the helper text — the only

is the title. expect((html.match(/ { const html = renderToStaticMarkup( Schedule one} />, ); expect(html).toContain('data-testid="cta"'); expect(html).toContain("Schedule one"); }); it("centres the layout (icon → text → action stack)", () => { const html = renderToStaticMarkup( cta} />, ); // The CardContent uses flex-col items-center text-center for the // canonical empty state layout. Lock that in so future tweaks // can't accidentally drop the centring. expect(html).toMatch(/flex-col items-center/); expect(html).toMatch(/text-center/); }); });