import React from "react";
import { vi } from "vitest";
import { render } from "@testing-library/react";
import { CategoryTitle } from "./index";
const tMock = vi.fn();
vi.mock("react-i18next", () => ({
    useTranslation: () => ({
        t: tMock,
    }),
}));
describe("CategoryTitle", () => {
    beforeEach(() => {
        vi.resetAllMocks();
    });
    it("renders the category title with translation", () => {
        tMock.mockImplementation((key) => `translated-${key}`);
        const { getByTestId } = render(React.createElement(CategoryTitle, { categoryKey: "transport" }));
        const title = getByTestId("category-title");
        expect(title).toHaveTextContent("translated-categories.transport");
        expect(tMock).toHaveBeenCalledWith("categories.transport");
    });
    it("applies the styles and className props", () => {
        tMock.mockReturnValue("Some Title");
        const { getByTestId } = render(React.createElement(CategoryTitle, { categoryKey: "transport", className: "custom-class" }));
        const title = getByTestId("category-title");
        expect(title.className).toContain("custom-class");
    });
    it("renders correctly with different categoryKey", () => {
        tMock.mockImplementation((key) => `translated-${key}`);
        const { getByTestId } = render(React.createElement(CategoryTitle, { categoryKey: "amenities" }));
        expect(getByTestId("category-title")).toHaveTextContent("translated-categories.amenities");
    });
});
//# sourceMappingURL=index.test.js.map