From 94536a01fd01b60dac454740b9b0a803012f1644 Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Mon, 6 Apr 2026 22:52:51 -0700 Subject: [PATCH] fix(test): update notes loop test for notesVisible guard behavior The fix adds a notesVisible guard that prevents re-opening notes when they are already visible, even if empty. Update the test to expect empty notes and direct advancement instead of re-opening. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../shared/tests/interview-notes-loop.test.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/resources/extensions/shared/tests/interview-notes-loop.test.ts b/src/resources/extensions/shared/tests/interview-notes-loop.test.ts index d138b4b38..5e0a5704b 100644 --- a/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +++ b/src/resources/extensions/shared/tests/interview-notes-loop.test.ts @@ -109,25 +109,23 @@ describe("interview-ui notes loop regression (#3502)", () => { assert.equal(answer.selected, "None of the above"); }); - it("still auto-opens notes when selecting 'None of the above' with no prior notes", async () => { + it("Enter on empty notes advances instead of re-opening (notesVisible guard)", async () => { // Press Down twice to "None of the above", Enter to select - // Then immediately Enter again (empty notes) — this should re-open notes - // because the guard only skips when notes are non-empty. - // Type something on second open, then Enter to proceed. + // Then immediately Enter again (empty notes) — notesVisible is already + // true from auto-open, so the guard prevents re-opening and Enter + // advances to review. The notes remain empty. const result = await runWithInputs(questions, [ DOWN, // cursor → 1 DOWN, // cursor → 2 (None of the above) - ENTER, // commit → auto-opens notes - ENTER, // empty notes → goNextOrSubmit → should re-open notes (empty guard) - "o", "k", // type "ok" - ENTER, // now notes = "ok" → should advance to review - ENTER, // submit + ENTER, // commit → auto-opens notes (notesVisible = true) + ENTER, // empty notes → notesVisible prevents re-open → advances to review + ENTER, // submit from review screen ]); assert.ok(result, "should return a result"); const answer = result.answers.q1; assert.ok(answer, "answer for q1 should exist"); - assert.equal(answer.notes, "ok"); + assert.equal(answer.notes, ""); }); it("normal option selection is unaffected", async () => {