test(tui): cover Enter skill draft preservation

This commit is contained in:
can1357
2026-07-17 04:26:04 +02:00
parent e7737110f0
commit 421584d2d0
@@ -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 () => {