import "@testing-library/jest-dom"; import React from "react"; import { Cards } from "./index"; import { render, screen } from "@testing-library/react"; jest.mock("@shared/components/text", () => ({ Text: ({ children, ...props }: any) => {children}, })); describe("Cards", () => { it("renders the Cards component", () => { render(); expect(screen.getByText("Cards")).toBeInTheDocument(); }); it("renders a div wrapper", () => { const { container } = render(); expect(container.querySelector("div")).toBeInTheDocument(); }); it("renders with empty fields object", () => { const { container } = render(); expect(container.firstChild).toBeTruthy(); }); it("renders Text component with Cards text", () => { render(); const text = screen.getByText("Cards"); expect(text).toBeInTheDocument(); expect(text.tagName).toBe("SPAN"); }); it("exports default Cards component", async () => { const mod = await import("./index"); expect(mod.default).toBeDefined(); }); });