Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline (Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/* packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import {
|
|
SLASH_ACTIONS,
|
|
serializeComposerPrompt,
|
|
truncateSlashDescription,
|
|
} from "./composer-slash.js";
|
|
|
|
describe("serializeComposerPrompt", () => {
|
|
it("returns draft when no skill or mentions", () => {
|
|
expect(serializeComposerPrompt(" hello", null, [])).toBe("hello");
|
|
});
|
|
|
|
it("prefixes skill slash name alone", () => {
|
|
expect(serializeComposerPrompt("", { name: "Daily standup" }, [])).toBe("/Daily standup");
|
|
});
|
|
|
|
it("combines skill, mentions, and draft", () => {
|
|
expect(
|
|
serializeComposerPrompt("check blockers", { name: "Daily standup" }, [
|
|
{ name: "Research Writer" },
|
|
]),
|
|
).toBe("/Daily standup\n@Research Writer check blockers");
|
|
});
|
|
|
|
it("prefixes mentions without a skill", () => {
|
|
expect(serializeComposerPrompt("go", null, [{ name: "everyone" }])).toBe("@everyone go");
|
|
});
|
|
});
|
|
|
|
describe("truncateSlashDescription", () => {
|
|
it("leaves short text alone", () => {
|
|
expect(truncateSlashDescription("short")).toBe("short");
|
|
});
|
|
|
|
it("truncates long text with an ellipsis", () => {
|
|
const long = "a".repeat(80);
|
|
expect(truncateSlashDescription(long, 20)).toBe(`${"a".repeat(19)}…`);
|
|
});
|
|
});
|
|
|
|
describe("SLASH_ACTIONS", () => {
|
|
it("exposes chat and account destinations", () => {
|
|
expect(SLASH_ACTIONS.map((action) => action.id)).toEqual([
|
|
"chat-settings",
|
|
"settings-general",
|
|
"settings-usage",
|
|
]);
|
|
});
|
|
});
|