swarm ui: the send button's off rule is a tested function
This commit is contained in:
parent
58e7cbf261
commit
2fe5759cdf
1 changed files with 18 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ import {
|
|||
matchCommands,
|
||||
menuQuery,
|
||||
moveSelection,
|
||||
sendDisabled,
|
||||
splitName,
|
||||
textToSend,
|
||||
} from "../src/agent/terminal/command-menu.ts";
|
||||
|
|
@ -127,3 +128,10 @@ test("any other message goes as it is", () => {
|
|||
assert.equal(textToSend("fix /etc/hosts"), "fix /etc/hosts");
|
||||
assert.equal(textToSend(" "), " ");
|
||||
});
|
||||
|
||||
test("send is off while sending and for a box with only whitespace", () => {
|
||||
assert.equal(sendDisabled("", false), true);
|
||||
assert.equal(sendDisabled(" \n ", false), true);
|
||||
assert.equal(sendDisabled("hi", true), true);
|
||||
assert.equal(sendDisabled("hi", false), false);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue