Skip to content

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

train: tests follow the train's choices

milind-soni9cafdaa69fd9
diff --git a/server/host/browser.test.ts b/server/host/browser.test.ts
index 4d4acb285a..6179a07e4f 100644
--- a/server/host/browser.test.ts
+++ b/server/host/browser.test.ts
@@ -538,14 +538,17 @@ describe("configured My Chrome targets", () => {
});
describe("how long an unused browser stays open", () => {
- it("is three minutes on a Cloud home and ten on a desktop, unless config.json sets it (including 0 for never)", () => {
+ it("is three minutes on a Cloud home and ten on a desktop, unless config.json sets it (0 for never, on a desktop only)", () => {
const cloud = setup(undefined, { cloudHome: true });
expect(cloud.host.browserIdleMs()).toBe(3 * 60_000);
cloud.cfg.browserEngine = { idleTimeoutMinutes: 20 };
expect(cloud.host.browserIdleMs()).toBe(20 * 60_000);
cloud.cfg.browserEngine = { idleTimeoutMinutes: 0 };
- expect(cloud.host.browserIdleMs()).toBe(0);
- expect(setup(undefined).host.browserIdleMs()).toBe(10 * 60_000);
+ expect(cloud.host.browserIdleMs(), "a Cloud home keeps closing unused browsers").toBe(3 * 60_000);
+ const desktop = setup(undefined);
+ expect(desktop.host.browserIdleMs()).toBe(10 * 60_000);
+ desktop.cfg.browserEngine = { idleTimeoutMinutes: 0 };
+ expect(desktop.host.browserIdleMs()).toBe(0);
});
});
diff --git a/src/components/settings/SettingsWindow.test.ts b/src/components/settings/SettingsWindow.test.ts
index 5d046e4638..f5b20cb181 100644
--- a/src/components/settings/SettingsWindow.test.ts
+++ b/src/components/settings/SettingsWindow.test.ts
@@ -328,11 +328,11 @@ describe("Settings → Features", () => {
expect(featureSwitches()).toEqual({ skillBurger: true, threadTabs: false, skillsLibrary: false });
fixture.switches.find((props) => (props as { "data-feature-switch"?: string })["data-feature-switch"] === "skillsLibrary")!.onClick!({} as never);
expect(api).toHaveBeenCalledWith("/api/config", { method: "PATCH", body: JSON.stringify({ features: { skillsLibrary: true } }) });
- fixture.config = { features: { skillBurger: true, threadTabs: false, skillsLibrary: true } };
+ fixture.config = { features: { skillBurger: true, threadTabs: false, skillsLibrary: true }, rooms: { turnTimeoutMinutes: 5 } };
render("features");
expect(featureSwitches()).toEqual({ skillBurger: true, threadTabs: false, skillsLibrary: true });
expect(render("bots"), "the switch reveals the Skills section it gates").toContain('data-settings-block="skills"');
- fixture.config = { features: { skillBurger: true, threadTabs: false, skillsLibrary: false } };
+ fixture.config = { features: { skillBurger: true, threadTabs: false, skillsLibrary: false }, rooms: { turnTimeoutMinutes: 5 } };
expect(render("bots")).not.toContain('data-settings-block="skills"');
});