import React from "react";
import { render } from "@testing-library/react";
import { describe, it, expect, vi } from "vitest";
import { Header } from ".";
const useLocalContentMock = vi.fn(() => ({
    handleMarkerClick: vi.fn(),
}));
vi.mock("~/sdks/LocalContent/context", () => ({
    useLocalContent: () => useLocalContentMock(),
}));
describe("Header", () => {
    it("renders the title and close icon", () => {
        const { getByText, getByTestId } = render(React.createElement(Header, { title: "Test Title" }));
        expect(getByText("Test Title")).toBeInTheDocument();
        expect(getByTestId("poi-popup-content-header-close-button")).toBeInTheDocument();
    });
    it("calls handleMarkerClick when closed", () => {
        const handleMarkerClickMock = vi.fn();
        useLocalContentMock.mockReturnValue({
            handleMarkerClick: handleMarkerClickMock,
        });
        const { getByTestId } = render(React.createElement(Header, { title: "Test Title" }));
        const closeButton = getByTestId("poi-popup-content-header-close-button");
        closeButton.click();
        expect(handleMarkerClickMock).toHaveBeenCalled();
    });
});
//# sourceMappingURL=index.test.js.map