diff --git a/apps/web/modules/survey/editor/components/conditional-logic.test.tsx b/apps/web/modules/survey/editor/components/conditional-logic.test.tsx
index 4f2b6dc0af..beb4ab04fa 100755
--- a/apps/web/modules/survey/editor/components/conditional-logic.test.tsx
+++ b/apps/web/modules/survey/editor/components/conditional-logic.test.tsx
@@ -241,4 +241,40 @@ describe("ConditionalLogic", () => {
expect(screen.getAllByTestId("logic-editor").length).toBe(2);
});
+
+ test("should clear logicFallback when logic array is empty and logicFallback exists (useEffect)", () => {
+ const mockUpdateQuestion = vi.fn();
+ const mockQuestion: TSurveyQuestion = {
+ id: "testQuestionId",
+ type: TSurveyQuestionTypeEnum.OpenText,
+ headline: { default: "Test Question" },
+ required: false,
+ inputType: "text",
+ charLimit: { enabled: false },
+ logic: [], // Empty logic array
+ logicFallback: "someTarget", // Has logicFallback but no logic
+ };
+ const mockSurvey = {
+ id: "testSurveyId",
+ name: "Test Survey",
+ type: "link",
+ createdAt: new Date(),
+ updatedAt: new Date(),
+ environmentId: "testEnvId",
+ status: "inProgress",
+ questions: [mockQuestion],
+ endings: [],
+ } as unknown as TSurvey;
+
+ render(
+