Skip to content

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

test(notifications): wait for the scheduled notice frame before checking it

Bugfixer 2876d7acc35ba
diff --git a/server/automation-reports.e2e.test.ts b/server/automation-reports.e2e.test.ts
index 970bf5060a..02835e7ed8 100644
--- a/server/automation-reports.e2e.test.ts
+++ b/server/automation-reports.e2e.test.ts
@@ -146,6 +146,7 @@ it("marks the notice of a run its schedule started as a scheduled report", async
await s.settled(id);
await s.reported(id, "posted");
expect(await s.run(id)).toMatchObject({ triggerSource: "schedule" });
+ await expect.poll(() => s.notified().some((notification) => notification.kind === "done"), { timeout: 10_000 }).toBe(true);
expect(s.notified().filter((notification) => notification.kind === "done")).toEqual([expect.objectContaining({ threadId: s.main, body: "Morning digest: Two new orders overnight.", routine: true })]);
}, 120_000);