Show free-write answers for OpenCode questions

This commit is contained in:
Mohamed Boudra
2026-06-04 15:13:47 +07:00
parent 3ecf86933f
commit 88d44ab2c5
3 changed files with 76 additions and 1 deletions
@@ -76,4 +76,27 @@ describe("question form card core", () => {
Response: "custom",
});
});
test("shows text input for questions that allow other answers", () => {
const questions = parseQuestionFormQuestions({
questions: [
{
question: "Pick or type",
header: "Response",
options: [{ label: "A" }],
allowOther: true,
multiSelect: false,
},
],
});
if (!questions) throw new Error("questions did not parse");
const [question] = questions;
if (!question) throw new Error("question missing");
expect(questionShowsTextInput(question)).toBe(true);
expect(areQuestionsAnswered(questions, {}, { 0: "custom" })).toBe(true);
expect(buildQuestionFormAnswers(questions, {}, { 0: "custom" })).toEqual({
Response: "custom",
});
});
});