Skip to content

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

test(bot-patch): narrow from two allowed accounts to one in the room-turn widening test

AdityaUmale48b5e392b0c1
diff --git a/server/routes/bot-patch.test.ts b/server/routes/bot-patch.test.ts
index 9c561a8836..2984e72565 100644
--- a/server/routes/bot-patch.test.ts
+++ b/server/routes/bot-patch.test.ts
@@ -399,17 +399,19 @@ describe("PATCH /api/bots/:id connectorScopes", () => {
activeGroupTurnForBot: (botId: string) => (botId === roomBotId ? { group: {} as never, threadId: "room-thread" } : null),
});
roomBotId = store.createBot({ name: "Room worker" }).id;
+ const firstAndSecond: ConnectorScopes = { apps: { gmail: "read" }, accounts: { gmail: ["first", "second"] } };
const firstOnly: ConnectorScopes = { apps: { gmail: "read" }, accounts: { gmail: ["first"] } };
- store.patchBot(bot.id, { connectorScopes: firstOnly });
+ store.patchBot(bot.id, { connectorScopes: firstAndSecond });
- const widened = await patch(bot.id, { connectorScopes: { apps: { gmail: "read" }, accounts: { gmail: ["first", "second"] } } });
+ const widened = await patch(bot.id, { connectorScopes: { apps: { gmail: "read" }, accounts: { gmail: ["first", "second", "third"] } } });
expect(widened.status).toBe(409);
- expect(store.bot(bot.id)?.connectorScopes).toEqual(firstOnly);
+ expect(store.bot(bot.id)?.connectorScopes).toEqual(firstAndSecond);
const narrowed = await patch(bot.id, { connectorScopes: firstOnly });
expect(narrowed.status).toBe(200);
+ expect(store.bot(bot.id)?.connectorScopes).toEqual(firstOnly);
});
});