perf(test): fold tui command parsing into tui suite

This commit is contained in:
Peter Steinberger
2026-02-15 23:47:58 +00:00
parent 2cf060f774
commit c82dc02b4d
2 changed files with 20 additions and 21 deletions

View File

@@ -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);
});
});

View File

@@ -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(