import { createRef } from "react"; import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; import { AppCard } from "@/components/ui/app-card"; import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Separator } from "@/components/ui/separator"; import { Textarea } from "@/components/ui/textarea"; import { Container } from "@/components/layout/container"; import { HeroBadge } from "@/components/layout/hero-badge"; import { SectionHeading } from "@/components/home/section-heading"; describe("Badge", () => { it("renders children and default variant classes", () => { render(New); const badge = screen.getByText("New"); expect(badge).toHaveClass("bg-primary"); }); it("applies a chosen variant and merges custom classNames", () => { render(OK); const badge = screen.getByText("OK"); expect(badge).toHaveClass("bg-status-success-soft"); expect(badge).toHaveClass("custom-class"); }); it("passes through arbitrary props", () => { render(X); expect(screen.getByTestId("b")).toHaveAttribute("title", "tip"); }); }); describe("Input", () => { it("forwards the ref and renders attributes", () => { const ref = createRef(); render(); const input = screen.getByPlaceholderText("you@example.com"); expect(ref.current).toBe(input); expect(input).toHaveAttribute("type", "email"); expect(input).toBeDisabled(); }); it("merges custom classes", () => { render(); expect(screen.getByLabelText("field")).toHaveClass("w-20"); }); }); describe("Textarea", () => { it("forwards the ref and renders a default value", () => { const ref = createRef(); render(