Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: stop a claude login whose dialog closed while it was starting

This commit is contained in:
iris 2026-10-21 20:58:54 +02:00 • committed by mara
commit 41cc2f5e8e
3 changed files with 24 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import {
claudeLoginPath,
leavesLoginRunning,
pastedCode,
startOutlivedDialog,
} from "../src/agent/claude-login/ClaudeLoginSteps.ts";
test("the routes name the agent, escaped", () => {
@ -48,6 +49,12 @@ test("only a login waiting for its code is stopped on close", () => {
assert.equal(leavesLoginRunning({ step: "stored" }), false);
});
test("a start that answers after the dialog closed is stopped, unless it failed", () => {
assert.equal(startOutlivedDialog(false, null), true);
assert.equal(startOutlivedDialog(true, null), false);
assert.equal(startOutlivedDialog(false, { detail: "no minter" }), false);
});
test("a pasted code is trimmed, and a blank one is nothing", () => {
assert.equal(pastedCode(" abc-def \n"), "abc-def");
assert.equal(pastedCode(" \n "), null);