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, waitFor } from "@testing-library/react";
import { ContactForm } 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}`,
        }) }));
}));
const mockUseRootElement = vi.fn();
vi.mock("../context", () => ({
    useRootElement: () => mockUseRootElement(),
}));
vi.mock("./PrivacyCheckbox", () => __awaiter(void 0, void 0, void 0, function* () {
    return ({
        PrivacyCheckbox: () => (React.createElement("div", { "data-testid": "privacy-consent" }, "Mocked PrivacyCheckbox")),
    });
}));
describe("Form Component", () => {
    it("renders with 4 text fields", () => __awaiter(void 0, void 0, void 0, function* () {
        render(React.createElement(ContactForm, null));
        yield waitFor(() => { });
        expect(screen.getByLabelText("translated:initialValues.firstName")).toBeInTheDocument();
        expect(screen.getByLabelText("translated:initialValues.lastName")).toBeInTheDocument();
        expect(screen.getByLabelText("translated:initialValues.email")).toBeInTheDocument();
        expect(screen.getByLabelText("translated:initialValues.phone")).toBeInTheDocument();
    }));
    it("privacy text is rendered", () => __awaiter(void 0, void 0, void 0, function* () {
        render(React.createElement(ContactForm, null));
        yield waitFor(() => { });
        const consentText = screen.getByTestId("privacy-consent");
        expect(consentText).toBeInTheDocument();
    }));
});
//# sourceMappingURL=index.test.js.map