From c82dc02b4d4089d46b15994f24cbba1375eb0c3b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 15 Feb 2026 23:47:58 +0000 Subject: [PATCH] perf(test): fold tui command parsing into tui suite --- src/tui/commands.test.ts | 21 --------------------- src/tui/tui.test.ts | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) delete mode 100644 src/tui/commands.test.ts diff --git a/src/tui/commands.test.ts b/src/tui/commands.test.ts deleted file mode 100644 index 5bd02b87d9c..00000000000 --- a/src/tui/commands.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { getSlashCommands, parseCommand } from "./commands.js"; - -describe("tui slash commands", () => { - it("treats /elev as an alias for /elevated", () => { - expect(parseCommand("/elev on")).toEqual({ name: "elevated", args: "on" }); - }); - - it("normalizes alias case", () => { - expect(parseCommand("/ELEV off")).toEqual({ - name: "elevated", - args: "off", - }); - }); - - it("includes gateway text commands", () => { - const commands = getSlashCommands({}); - expect(commands.some((command) => command.name === "context")).toBe(true); - expect(commands.some((command) => command.name === "commands")).toBe(true); - }); -}); diff --git a/src/tui/tui.test.ts b/src/tui/tui.test.ts index 7ef276526bf..aa60f12109b 100644 --- a/src/tui/tui.test.ts +++ b/src/tui/tui.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; +import { getSlashCommands, parseCommand } from "./commands.js"; import { resolveFinalAssistantText, resolveTuiSessionKey } from "./tui.js"; describe("resolveFinalAssistantText", () => { @@ -16,6 +17,25 @@ describe("resolveFinalAssistantText", () => { }); }); +describe("tui slash commands", () => { + it("treats /elev as an alias for /elevated", () => { + expect(parseCommand("/elev on")).toEqual({ name: "elevated", args: "on" }); + }); + + it("normalizes alias case", () => { + expect(parseCommand("/ELEV off")).toEqual({ + name: "elevated", + args: "off", + }); + }); + + it("includes gateway text commands", () => { + const commands = getSlashCommands({}); + expect(commands.some((command) => command.name === "context")).toBe(true); + expect(commands.some((command) => command.name === "commands")).toBe(true); + }); +}); + describe("resolveTuiSessionKey", () => { it("uses global only as the default when scope is global", () => { expect(