import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { EmptyState } from "./empty-state";
describe("empty-state", () => {
it("renders the default title and message", () => {
render();
expect(screen.getByRole("heading", { name: "No data" })).toBeInTheDocument();
expect(screen.getByText("There are no items to display.")).toBeInTheDocument();
});
it("renders a custom title and message", () => {
render();
expect(screen.getByRole("heading", { name: "No products" })).toBeInTheDocument();
expect(screen.getByText("Create your first product.")).toBeInTheDocument();
});
it("renders the action when provided", () => {
render(Create} />);
expect(screen.getByRole("button", { name: "Create" })).toBeInTheDocument();
});
it("omits the icon container when no icon is provided", () => {
render(} />);
expect(screen.getByTestId("icon")).toBeInTheDocument();
});
});