Skip to content

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

Train fix: the Inbox e2e reads the news a finished hand-off leaves

milind-sonid3ab48b4d20f
diff --git a/server/place-inbox.e2e.test.ts b/server/place-inbox.e2e.test.ts
index 3db7bc7281..c8dbfa8951 100644
--- a/server/place-inbox.e2e.test.ts
+++ b/server/place-inbox.e2e.test.ts
@@ -167,6 +167,14 @@ describe.each([
expect((await call("POST", `/api/threads/${row.origin!.threadId}/respond`, { requestId: row.card!.requestId, behavior: "answer", message: "Home" })).status).toBe(200);
await until(async () => (await h.messages(row.origin!.threadId)).some((line) => line.text === "W1-E: Home"), "the work to go on");
expect((await h.listed()).some((one) => one.id === row.id)).toBe(false);
+ // The finished work leaves one news line, which Mira's summary replaces once she reports back; reading it clears it.
+ const results = async () => (await h.listed()).filter((one) => one.kind === "result" && (one.from.name === mira.name || one.from.name === eli.name));
+ await until(async () => (await results()).some((one) => one.from.name === mira.name), "Mira's summary in the inbox");
+ const news = await results();
+ expect(news).toHaveLength(1);
+ expect(news[0]!.unread).toBe(true);
+ expect((await call("POST", `/api/inbox/${news[0]!.id}/read`)).status).toBe(200);
+ expect(await h.count()).toBe(0);
}, hostTimeout(180_000));
it("clears news once it is read, and keeps it listed until it is done", async () => {