Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

test: forget a hand-off whose lookup is gone

Bugfixer 204d754aa7e85
diff --git a/server/host/wait-words.test.ts b/server/host/wait-words.test.ts
index 72f0831f59..8f8392df54 100644
--- a/server/host/wait-words.test.ts
+++ b/server/host/wait-words.test.ts
@@ -97,6 +97,20 @@ describe("a hand-off held a while", () => {
expect(posted).toEqual(["a", "b", "c"]);
});
+ it("forgets a hand-off whose lookup is gone", () => {
+ const held = new Map(["a", "b", "c"].map((id) => [id, { ...node, id, status: "resume" } as HandoffView]));
+ const looked: string[] = [];
+ const posted: string[] = [];
+ const { note } = notes({ threadBusy: () => true, node: (id) => (looked.push(id), held.get(id)), post: (_p, n) => posted.push(n.id) });
+ note(held.get("a")!);
+ held.delete("a");
+ note(held.get("b")!);
+ looked.length = 0;
+ note(held.get("c")!);
+ expect(looked).toEqual(["b"]);
+ expect(posted).toEqual(["a", "b", "c"]);
+ });
+
it("stays quiet for a short hold, a room's own hand-off, a computer's wait and a person's open card, which say so themselves", () => {
const busy = { threadBusy: () => true };
for (const { over, at, row } of [