Watch
0
0
Fork
You've already forked hyperhive
0

swarm ui: the send button's off rule is a tested function

This commit is contained in:
iris 2026-11-16 18:12:01 +01:00
commit 2fe5759cdf

View file

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