import { render, screen } from "@testing-library/react"; import { expect, it, describe } from "vitest"; import { Banner } from "./Banner.component"; describe("Banner", () => { describe("Snapshots", () => { it("should match snapshot", () => { const res = render(); expect(res).toMatchSnapshot(); }); it("should match snapshot with variant", () => { const res = render(); expect(res).toMatchSnapshot(); }); }); it("should forward props to the element", () => { render(); expect(screen.getByTestId("aje-banner")).toBeInTheDocument(); expect(screen.getByTestId("aje-banner")).toHaveClass("test"); expect(screen.getByTestId("aje-banner")).toHaveAttribute("data-attribute"); }); describe("Banner.Content", () => { it("should match snapshot", () => { const res = render(Content); expect(res).toMatchSnapshot(); }); }); describe("Banner.IconButton", () => { it("should match snapshot", () => { const res = render(); expect(res).toMatchSnapshot(); }); }); describe("Banner.Button", () => { it("should match snapshot", () => { const res = render(Button); expect(res).toMatchSnapshot(); }); }); });