var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import React from "react";
import { describe, it, expect, vi } from "vitest";
import { render, screen } from "@testing-library/react";
import { DownloadCard } from "./index";
// Mock dependencies
vi.mock("react-i18next", (importOriginal) => __awaiter(void 0, void 0, void 0, function* () {
    return (Object.assign(Object.assign({}, (yield importOriginal())), { useTranslation: () => ({
            t: (key) => `translated:${key}`,
        }) }));
}));
vi.mock("~/tracking", () => ({
    useTracking: () => ({
        postEvent: vi.fn(),
        trackAnalyticsEvent: vi.fn(),
    }),
}));
const useLeadCaptureMock = vi.fn(() => ({
    country: "USA",
    setSelectedReport: vi.fn(),
}));
vi.mock("~/sdks/LeadCapture/context", () => ({
    useLeadCapture: () => useLeadCaptureMock(),
}));
describe("DownloadCard has translated text", () => {
    it("renders correctly", () => {
        render(React.createElement(DownloadCard, null));
        expect(screen.getByText("translated:downloadCard.title")).toBeInTheDocument();
        expect(screen.getByText("translated:downloadCard.description")).toBeInTheDocument();
        expect(screen.getByText("translated:downloadCard.cta")).toBeInTheDocument();
    });
    it("DownloadCard displays dropdown", () => {
        render(React.createElement(DownloadCard, null));
        const select = screen.getByTestId("select-reportTypeFilter");
        expect(select).toHaveTextContent("translated:downloadCard.select.default");
    });
    it("DownloadCard displays image in Canada", () => {
        useLeadCaptureMock.mockReturnValue({
            country: "CAN",
        });
        render(React.createElement(DownloadCard, null));
        const select = screen.getByTestId("lifestyle-report-image");
        expect(select).toBeInTheDocument();
    });
});
//# sourceMappingURL=index.test.js.map