diff --git a/apps/fabro-web/app/components/interview-dock.test.tsx b/apps/fabro-web/app/components/interview-dock.test.tsx index 34a58269f..6fb48bfb9 100644 --- a/apps/fabro-web/app/components/interview-dock.test.tsx +++ b/apps/fabro-web/app/components/interview-dock.test.tsx @@ -133,6 +133,27 @@ describe("InterviewDock", () => { expect(buttons.Revise).toBeDefined(); }); + test("multiple choice renders option descriptions as display text", () => { + const question = makeQuestion({ + question_type: QuestionType.MULTIPLE_CHOICE, + options: [ + { + key: "A", + label: "[A] Approve", + description: "Deploy the current patch", + preview: "not rendered specially", + }, + ], + }); + const tree = render( + , + ); + const text = textContent(tree.toJSON()); + expect(text).toContain("Approve"); + expect(text).toContain("Deploy the current patch"); + expect(text).not.toContain("not rendered specially"); + }); + test("freeform question renders a textarea and disables send when empty", () => { const question = makeQuestion({ question_type: QuestionType.FREEFORM, diff --git a/apps/fabro-web/app/components/interview-dock.tsx b/apps/fabro-web/app/components/interview-dock.tsx index 35eb2fcf5..967044907 100644 --- a/apps/fabro-web/app/components/interview-dock.tsx +++ b/apps/fabro-web/app/components/interview-dock.tsx @@ -15,7 +15,7 @@ import { import { QuestionType } from "@qltysh/fabro-api-client"; import type { ApiQuestion, - ApiQuestionOption, + InterviewOption, } from "@qltysh/fabro-api-client"; import { @@ -270,7 +270,7 @@ function ChoiceBody({ submitting, onSubmit, }: { - options: ApiQuestionOption[]; + options: InterviewOption[]; allowFreeform: boolean; submitting: boolean; onSubmit: (answer: SubmitInterviewAnswer) => Promise; @@ -287,7 +287,7 @@ function ChoiceBody({ onClick={() => void onSubmit({ kind: "selected", option_key: option.key })} className={CHOICE_BUTTON} > - {displayLabel(option.label)} + ))} @@ -314,7 +314,7 @@ function MultiSelectBody({ submitting, onSubmit, }: { - options: ApiQuestionOption[]; + options: InterviewOption[]; submitting: boolean; onSubmit: (answer: SubmitInterviewAnswer) => Promise; }) { @@ -346,7 +346,7 @@ function MultiSelectBody({ className={isSelected ? CHOICE_BUTTON_SELECTED : CHOICE_BUTTON} > {isSelected &&