From 421584d2d00a4e876ccf108124d2f06aa9a91474 Mon Sep 17 00:00:00 2001 From: can1357 Date: Fri, 17 Jul 2026 04:26:04 +0200 Subject: [PATCH] test(tui): cover Enter skill draft preservation --- packages/tui/test/editor-autocomplete-actions.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/tui/test/editor-autocomplete-actions.test.ts b/packages/tui/test/editor-autocomplete-actions.test.ts index 560f02fe1..abcabf0aa 100644 --- a/packages/tui/test/editor-autocomplete-actions.test.ts +++ b/packages/tui/test/editor-autocomplete-actions.test.ts @@ -285,9 +285,9 @@ describe("Editor Enter handler sync slash completion", () => { expect(editor.isShowingAutocomplete()).toBe(false); }); - it("accepts a bare mid-prompt skill slash with Enter and submits the completed prompt", async () => { + it("accepts a bare mid-prompt skill slash with Enter without submitting the draft", async () => { const editor = createSkillEditor(); - let submitted = ""; + let submitted: string | undefined; editor.onSubmit = text => { submitted = text; }; @@ -295,8 +295,8 @@ describe("Editor Enter handler sync slash completion", () => { await openMidPromptSkillAutocomplete(editor, "run a "); editor.handleInput("\r"); - expect(submitted).toBe("run a /skill:security-scan"); - expect(editor.getText()).toBe(""); + expect(submitted).toBeUndefined(); + expect(editor.getText()).toBe("run a /skill:security-scan "); }); it("hides mid-prompt skill autocomplete immediately when Backspace removes the slash", async () => {