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(<InvoiceStatusBadge status={InvoiceStatus.DRAFT} />);
    expect(screen.getByText("Entwurf")).toBeInTheDocument();
  });

  it("should render SENT status correctly", () => {
    render(<InvoiceStatusBadge status={InvoiceStatus.SENT} />);
    expect(screen.getByText("Versendet")).toBeInTheDocument();
  });

  it("should render PAID status correctly", () => {
    render(<InvoiceStatusBadge status={InvoiceStatus.PAID} />);
    expect(screen.getByText("Bezahlt")).toBeInTheDocument();
  });

  it("should render CANCELLED status correctly", () => {
    render(<InvoiceStatusBadge status={InvoiceStatus.CANCELLED} />);
    expect(screen.getByText("Storniert")).toBeInTheDocument();
  });

  it("should render DELETED status correctly", () => {
    render(<InvoiceStatusBadge status={InvoiceStatus.DELETED} />);
    expect(screen.getByText("Gelöscht")).toBeInTheDocument();
  });

  it("should have proper badge structure", () => {
    render(<InvoiceStatusBadge status={InvoiceStatus.PAID} />);
    const badge = screen.getByText("Bezahlt");
    expect(badge).toBeInTheDocument();
    // Badge should be a div element
    expect(badge.tagName).toBe("DIV");
  });
});
