From bf7181ba2f6a355c3ddbef8a2b5bd2aa46adbe85 Mon Sep 17 00:00:00 2001 From: Soon-Mi Sugihara Date: Tue, 21 Nov 2023 13:39:11 -0500 Subject: [PATCH] Fix survey logic test --- frontend/src/scenes/surveys/surveyLogic.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/scenes/surveys/surveyLogic.tsx b/frontend/src/scenes/surveys/surveyLogic.tsx index 654e28cdf04c8..6fc5c1f4e08f0 100644 --- a/frontend/src/scenes/surveys/surveyLogic.tsx +++ b/frontend/src/scenes/surveys/surveyLogic.tsx @@ -336,12 +336,8 @@ export const surveyLogic = kea([ // Zero-fill choices that are not open-ended question.choices.forEach((choice, idx) => { - if ( - results?.length && - idx === question.choices.length - 1 && - question?.has_open_choice && - !results.some((r) => r[1] === choice) - ) { + const isOpenChoice = idx == question.choices.length - 1 && question?.has_open_choice + if (results?.length && !isOpenChoice && !results.some((r) => r[1] === choice)) { results.push([0, choice]) } })