diff --git a/apps/web/modules/survey/editor/components/cal-question-form.test.tsx b/apps/web/modules/survey/editor/components/cal-question-form.test.tsx new file mode 100755 index 0000000000..3e57a1475a --- /dev/null +++ b/apps/web/modules/survey/editor/components/cal-question-form.test.tsx @@ -0,0 +1,335 @@ +import { cleanup, render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { afterEach, describe, expect, test, vi } from "vitest"; +import { TSurvey, TSurveyCalQuestion, TSurveyQuestionTypeEnum } from "@formbricks/types/surveys/types"; +import { CalQuestionForm } from "./cal-question-form"; + +// Mock necessary modules and components +vi.mock("@/modules/ui/components/advanced-option-toggle", () => ({ + AdvancedOptionToggle: ({ + isChecked, + onToggle, + htmlId, + children, + title, + }: { + isChecked: boolean; + onToggle?: (checked: boolean) => void; + htmlId?: string; + children?: React.ReactNode; + title?: string; + }) => { + let content; + if (onToggle && htmlId) { + content = ( + onToggle(!isChecked)} + data-testid="cal-host-toggle" + /> + ); + } else { + content = isChecked ? "Enabled" : "Disabled"; + } + + return ( +
{description}
+