swarm ui: a lone /word goes without the space completion leaves
This commit is contained in:
parent
299b922039
commit
2f3c9253bf
1 changed files with 27 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ import {
|
|||
menuQuery,
|
||||
moveSelection,
|
||||
splitName,
|
||||
textToSend,
|
||||
} from "../src/agent/terminal/command-menu.ts";
|
||||
|
||||
const cmd = (name, kind = "command", description = "") => ({
|
||||
|
|
@ -113,3 +114,16 @@ test("without the backend's /clear command, or with a skill of that name, it is
|
|||
assert.equal(controlRoute("/clear", []), null);
|
||||
assert.equal(controlRoute("/clear", [cmd("clear", "skill")]), null);
|
||||
});
|
||||
|
||||
test("a lone slash word goes without the space completion left", () => {
|
||||
assert.equal(textToSend("/compact "), "/compact");
|
||||
assert.equal(textToSend("/compact"), "/compact");
|
||||
assert.equal(textToSend(" /base:pr-review "), "/base:pr-review");
|
||||
});
|
||||
|
||||
test("any other message goes as it is", () => {
|
||||
assert.equal(textToSend("hello "), "hello ");
|
||||
assert.equal(textToSend("/compact now "), "/compact now ");
|
||||
assert.equal(textToSend("fix /etc/hosts"), "fix /etc/hosts");
|
||||
assert.equal(textToSend(" "), " ");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue