import React from "react";
import { vi } from "vitest";
import { render, screen } from "@testing-library/react";
import { Category } from "./index";
const tMock = vi.fn();
vi.mock("react-i18next", () => ({
    useTranslation: () => ({
        t: tMock,
    }),
}));
describe("Category", () => {
    beforeEach(() => {
        vi.resetAllMocks();
    });
    it("renders without crashing", () => {
        render(React.createElement(Category, { categoryKey: "transport" }));
        expect(screen.getByTestId("sidebar-category")).toBeInTheDocument();
    });
    it("renders children correctly", () => {
        render(React.createElement(Category, { categoryKey: "transport" },
            React.createElement("div", { "data-testid": "child" }, "Child Content")));
        expect(screen.getByTestId("child")).toHaveTextContent("Child Content");
    });
    it("renders the CategoryTitle with the correct categoryKey", () => {
        render(React.createElement(Category, { categoryKey: "transport" }));
        const title = screen.getByTestId("category-title");
        expect(title).toBeInTheDocument();
        expect(title).toHaveAttribute("data-category-key", "transport");
    });
});
//# sourceMappingURL=index.test.js.map