import React from "react";
import { vi } from "vitest";
import { render } from "@testing-library/react";
import { Root } from "./index";
vi.mock("./context", () => ({
    RootElementContextProvider: ({ isLoading, children, }) => (React.createElement("div", { "data-testid": "root-element-context-provider", "data-is-loading": isLoading }, children)),
}));
describe("Root", () => {
    it("renders children correctly", () => {
        const { getByText } = render(React.createElement(Root, null,
            React.createElement("div", null, "Test Child")));
        expect(getByText("Test Child")).toBeInTheDocument();
    });
    it("passes isLoading to context provider", () => {
        const { getByTestId } = render(React.createElement(Root, { isLoading: true },
            React.createElement("div", null, "Child Content")));
        const contextProvider = getByTestId("root-element-context-provider");
        expect(contextProvider).toHaveAttribute("data-is-loading", "true");
    });
    it("merges class names correctly", () => {
        const { getByTestId } = render(React.createElement(Root, { className: "test-class" }, "Content"));
        const container = getByTestId("score-section-root");
        expect(container).toHaveClass("test-class");
    });
    it("defaults isLoading to false when not provided", () => {
        const { getByTestId } = render(React.createElement(Root, null, "Content"));
        const contextProvider = getByTestId("root-element-context-provider");
        expect(contextProvider).toHaveAttribute("data-is-loading", "false");
    });
});
//# sourceMappingURL=index.test.js.map