import { describe, it, expect } from "vitest"; import { render, screen } from "@testing-library/react"; import { InvoiceStatusBadge } from "@/components/invoice/invoice-status-badge"; import { InvoiceStatus } from "@prisma/client"; describe("InvoiceStatusBadge", () => { it("should render DRAFT status correctly", () => { render(); expect(screen.getByText("Entwurf")).toBeInTheDocument(); }); it("should render SENT status correctly", () => { render(); expect(screen.getByText("Versendet")).toBeInTheDocument(); }); it("should render PAID status correctly", () => { render(); expect(screen.getByText("Bezahlt")).toBeInTheDocument(); }); it("should render CANCELLED status correctly", () => { render(); expect(screen.getByText("Storniert")).toBeInTheDocument(); }); it("should render DELETED status correctly", () => { render(); expect(screen.getByText("Gelöscht")).toBeInTheDocument(); }); it("should have proper badge structure", () => { render(); const badge = screen.getByText("Bezahlt"); expect(badge).toBeInTheDocument(); // Badge should be a div element expect(badge.tagName).toBe("DIV"); }); });