import { render, screen } from "@testing-library/react";
import { Alert } from "./Alert";
describe("Tests for Alert component", () => {
test("Should render text", () => {
render();
expect(screen.getByText("I'm an Alert!")).toBeInTheDocument();
expect(screen.getByText("Hello World")).toBeInTheDocument();
});
test("Should render actions", () => {
render(Click Me} />);
expect(screen.getByText("Click Me")).toBeInTheDocument();
});
test("Should render corresponding icon: error", () => {
render();
expect(screen.getByTestId("x-circle")).toBeInTheDocument();
});
test("Should render corresponding icon: warning", () => {
render();
expect(screen.getByTestId("alert-triangle")).toBeInTheDocument();
});
test("Should render corresponding icon: info", () => {
render();
expect(screen.getByTestId("info")).toBeInTheDocument();
});
test("Should render corresponding icon: neutral", () => {
render();
expect(screen.getByTestId("neutral")).toBeInTheDocument();
});
test("Should render corresponding icon: success", () => {
render();
expect(screen.getByTestId("check-circle-2")).toBeInTheDocument();
});
});