import React from "react";
import { vi } from "vitest";
import { render } from "@testing-library/react";
import { Item } from "./index";
vi.mock("./Icon", () => ({
    Icon: ({ isLoading, score }) => (React.createElement("div", { "data-testid": "icon" }, isLoading ? "loading" : score ? `score: ${score}` : "no icon")),
}));
vi.mock("./Content", () => ({
    Content: ({ score }) => (React.createElement("div", { "data-testid": "content" }, score ? `content for ${score}` : "no content")),
}));
describe("Item", () => {
    it("renders the loading state correctly", () => {
        const { getByTestId } = render(React.createElement(Item, { isLoading: true }));
        const item = getByTestId("item");
        expect(item).toHaveAttribute("data-is-loading", "true");
    });
    it("renders the icon component", () => {
        const { getByTestId } = render(React.createElement(Item, { isLoading: false, score: "pedestrian_friendly" }));
        const icon = getByTestId("icon");
        expect(icon).toHaveTextContent("score: pedestrian_friendly");
    });
    it("renders the content component", () => {
        const { getByTestId } = render(React.createElement(Item, { isLoading: false, score: "pedestrian_friendly" }));
        const content = getByTestId("content");
        expect(content).toHaveTextContent("content for pedestrian_friendly");
    });
});
//# sourceMappingURL=index.test.js.map