Skip to content

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

test(team-inbox): put Marco's busy hour at noon, so it never runs past midnight (#3780)

Milind Soni65bba93a9274
diff --git a/server/cloud-team-inbox.e2e.test.ts b/server/cloud-team-inbox.e2e.test.ts
index adfbbc4cde..8ec937791c 100644
--- a/server/cloud-team-inbox.e2e.test.ts
+++ b/server/cloud-team-inbox.e2e.test.ts
@@ -175,7 +175,10 @@ beforeAll(async () => {
expect((await team.as(marco, "POST", "/api/team/my-connections/apps/googlecalendar/connect", {})).status).toBe(200);
const marcoUser = broker.userFor(broker.installationIds().at(-1)!);
broker.account(marcoUser, "googlecalendar", MARCO.email);
- const start = Math.ceil((Date.now() + 2 * 24 * 60 * 60_000) / (60 * 60_000)) * 60 * 60_000;
+ // At noon two days on, so the busy hour never runs past midnight, which the prompt words as two days.
+ const noon = new Date(Date.now() + 2 * 24 * 60 * 60_000);
+ noon.setHours(12, 0, 0, 0);
+ const start = noon.getTime();
broker.calendarEvents[marcoUser] = [{ id: "ev1", summary: "Interview at Globex", status: "confirmed", location: "Globex HQ", attendees: [{ email: "[email protected]" }],
start: { dateTime: new Date(start).toISOString() }, end: { dateTime: new Date(start + 60 * 60_000).toISOString() } }];
marcos = listen(marco);