swarm-ui: the cancel badge clears when the next turn starts
This commit is contained in:
parent
2f2b4aa9e2
commit
8060e91939
1 changed files with 65 additions and 6 deletions
|
|
@ -5,6 +5,7 @@ import {
|
|||
canCancel,
|
||||
cancelNote,
|
||||
cancelPath,
|
||||
statusOnTurnChange,
|
||||
} from "../src/agent/terminal/cancel.ts";
|
||||
|
||||
test("cancel is offered while the agent is in a turn, and only then", () => {
|
||||
|
|
@ -23,3 +24,26 @@ test("the note says whether a turn was stopped", () => {
|
|||
assert.equal(cancelNote(true), "turn cancelled");
|
||||
assert.equal(cancelNote(false), "nothing was running");
|
||||
});
|
||||
|
||||
test("the answer stays after its turn ends and clears when the next starts", () => {
|
||||
assert.equal(statusOnTurnChange("done", "thinking", "idle"), "done");
|
||||
assert.equal(statusOnTurnChange("done", "idle", "idle"), "done");
|
||||
assert.equal(statusOnTurnChange("done", "idle", "thinking"), "idle");
|
||||
});
|
||||
|
||||
test("a failure clears when its turn ends, or a new one starts", () => {
|
||||
assert.equal(statusOnTurnChange("error", "thinking", "thinking"), "error");
|
||||
assert.equal(statusOnTurnChange("error", "thinking", "idle"), "idle");
|
||||
assert.equal(statusOnTurnChange("error", "idle", "thinking"), "idle");
|
||||
});
|
||||
|
||||
test("a cancel in flight is left alone", () => {
|
||||
assert.equal(
|
||||
statusOnTurnChange("cancelling", "thinking", "idle"),
|
||||
"cancelling",
|
||||
);
|
||||
assert.equal(
|
||||
statusOnTurnChange("cancelling", "idle", "thinking"),
|
||||
"cancelling",
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue