Skip to content

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

test(ui): the renderer e2e tests follow the current sidebar, Team map and settings (#3700)

Aditya Umale9235ff897ef2
diff --git a/scripts/testing/control-omb-ui.ts b/scripts/testing/control-omb-ui.ts
index dd4c8d669d..e22b5ab9ba 100644
--- a/scripts/testing/control-omb-ui.ts
+++ b/scripts/testing/control-omb-ui.ts
@@ -29,6 +29,8 @@ const ROOT = fileURLToPath(new URL("../..", import.meta.url));
export const UI_TOOLS_DIR = join(ROOT, ".omb-scratch", "verify-tools");
/** Verbs that change the fixture or the page; they take the explicit handle, never discovery. */
export const UI_MUTATING = new Set(["click", "type", "press", "flag", "eval"]);
+/** The sidebar's Tools section starts open, and a click on its header closes it. */
+export const OPEN_SIDEBAR_TOOLS = "(() => { document.querySelector('[data-tour=tools] button[aria-expanded=false]')?.click(); return true; })()";
const ENTRIES = {
threads: { entry: "/scripts/testing/threads-preview.tsx", route: "/__threads.html", title: "Isolated OpenMaus Chat" },
diff --git a/scripts/testing/slack-management-ui.e2e.test.ts b/scripts/testing/slack-management-ui.e2e.test.ts
index d21b8d2bae..ced12863b3 100644
--- a/scripts/testing/slack-management-ui.e2e.test.ts
+++ b/scripts/testing/slack-management-ui.e2e.test.ts
@@ -124,7 +124,8 @@ describe("Slack management in agent settings", () => {
await evaluate("window.slackFixture.mode = 'ready'; true");
await openProfile();
await expect.poll(row, { timeout: 10_000 }).toBe(true);
- await click("Slack");
+ // Slack is still the open section from the first agent's settings.
+ await evaluate("document.querySelector('[data-bot-settings-section=slack] > button[aria-expanded=false]')?.click(); true");
const expected = `https://admin.example.test/slack?workspace=acme&bot=${second.id}`;
await expect.poll(link, { timeout: 10_000 }).toBe(expected);
await evaluate("window.slackFixture.pending.forEach(resolve => resolve()); true");
diff --git a/scripts/testing/team-canvas-ui.e2e.test.ts b/scripts/testing/team-canvas-ui.e2e.test.ts
index 530e84d24b..ed74543f5e 100644
--- a/scripts/testing/team-canvas-ui.e2e.test.ts
+++ b/scripts/testing/team-canvas-ui.e2e.test.ts
@@ -6,7 +6,7 @@ import { expect, it } from "vitest";
import { resolveAgentBrowserBinary } from "../../server/browser-engine.ts";
import { waitForExit } from "../../server/testing/cleanup.ts";
import { runControlOmb } from "../control-omb.ts";
-import { UI_TOOLS_DIR } from "./control-omb-ui.ts";
+import { OPEN_SIDEBAR_TOOLS, UI_TOOLS_DIR } from "./control-omb-ui.ts";
import { fixtureApi } from "./preview-fixture.ts";
const ROOT = fileURLToPath(new URL("../..", import.meta.url));
@@ -73,7 +73,7 @@ type BotRecord = {
})()`);
const messages = async (id: string) => (await control("messages", "--bot", id, "--limit", "10")).messages;
const openMap = async () => {
- await click("Tools");
+ await evaluate(OPEN_SIDEBAR_TOOLS);
await click("Team map");
await expect.poll(() => evaluate("Boolean(document.querySelector('[data-team-canvas]'))"), { timeout: 10_000 }).toBe(true);
};
@@ -154,7 +154,7 @@ type BotRecord = {
expect(await snapshot()).toContain('region "Team canvas"');
for (const name of ["Ada", "Ben", "Cleo", "Dana"]) expect(await snapshot()).toContain(`Change default model for ${name}`);
expect(await evaluate("[...document.querySelectorAll('[data-team-key] article span')].some(span => span.textContent.trim() === 'Ready')")).toBe(false);
- expect(await evaluate("document.querySelectorAll('[data-team-canvas] [aria-label^=\"Computer for \"]').length")).toBe(0);
+ expect(await evaluate("document.querySelectorAll('[data-team-canvas] [aria-label^=\"Desktop for \"]').length")).toBe(0);
// The full-app fixture has no Boat credentials. The explicit + entry
// explains paid creation, but cannot allocate anything until connected.
@@ -162,18 +162,18 @@ type BotRecord = {
expect(beforeComputers.configured).toBe(false);
await evaluate("document.querySelector('summary[aria-label=\"Add to team map\"]').focus(); true");
await ui("press", "--keys", "Enter");
- await click("Cloud computer");
+ await click("Cloud desktop");
await expect.poll(snapshot).toContain("Connect your Boat account before creating a cloud desktop.");
await expect.poll(snapshot).toContain("Your Boat plan and usage charges apply.");
const inputRefs = (await ui("snapshot")).refs as Record<string, { role: string; name: string }>;
const nameInput = Object.entries(inputRefs).filter(([, entry]) => entry.role === "textbox" && entry.name === "New cloud desktop");
expect(nameInput).toHaveLength(1);
await ui("type", "--ref", `@${nameInput[0][0]}`, "--text", "Fixture desktop");
- expect(await evaluate("document.querySelector('[aria-label=\"Team computers\"] button[type=submit]').disabled")).toBe(true);
+ expect(await evaluate("document.querySelector('aside[aria-label=\"Desktops\"] button[type=submit]').disabled")).toBe(true);
expect((await api("GET", "/api/team-computers")).computers).toEqual(beforeComputers.computers);
await click("Cancel");
- await click("Close computers");
- expect(await evaluate("Boolean(document.querySelector('[aria-label=\"Team computers\"]'))")).toBe(false);
+ await click("Close desktops");
+ expect(await evaluate("Boolean(document.querySelector('aside[aria-label=\"Desktops\"]'))")).toBe(false);
receipts.unconfiguredComputerCreation = "Explicit Add entry shows cost disclosure and keeps Create cloud desktop disabled without credentials.";
await evaluate(`(() => {
@@ -188,12 +188,12 @@ type BotRecord = {
await click("Edit Ben");
await expect.poll(snapshot).toContain('dialog "Ben"');
expect(await evaluate("Boolean(document.querySelector('[data-team-canvas]'))")).toBe(true);
- await expect.poll(() => evaluate("[...document.querySelectorAll('[data-team-canvas] [aria-label^=\"Computer for \"]')].map(button => button.getAttribute('aria-label'))"))
- .toEqual(["Computer for Ben"]);
- await click("Computer for Ben");
+ await expect.poll(() => evaluate("[...document.querySelectorAll('[data-team-canvas] [aria-label^=\"Desktop for \"]')].map(button => button.getAttribute('aria-label'))"))
+ .toEqual(["Desktop for Ben"]);
+ await click("Desktop for Ben");
await expect.poll(() => evaluate("document.querySelector('[data-bot-settings-section=access] > button')?.getAttribute('aria-expanded')")).toBe("true");
await click("Close settings");
- await expect.poll(() => evaluate("document.querySelectorAll('[data-team-canvas] [aria-label^=\"Computer for \"]').length")).toBe(0);
+ await expect.poll(() => evaluate("document.querySelectorAll('[data-team-canvas] [aria-label^=\"Desktop for \"]').length")).toBe(0);
await click("Change default model for Ben");
await expect.poll(() => evaluate("document.querySelector('[data-bot-settings-section=model] > button')?.getAttribute('aria-expanded')")).toBe("true");
expect(await snapshot()).toContain("Default model");
@@ -251,7 +251,7 @@ type BotRecord = {
const cardSelector = `[data-bot-id=${JSON.stringify(ben.id)}]`;
receipts.cancelledDrop = await drag(cardSelector, { x: 0, y: 0 }, teamSelector("Research"));
await expect.poll(snapshot).toContain('alertdialog "Move Ben to Research?"');
- expect(await snapshot()).toContain("This changes the bot's home team and shared instructions, not just its position.");
+ expect(await snapshot()).toContain("This changes the bot's home department and shared instructions, not just its position.");
expect((await savedBot(ben.id)).section).toBe("Delivery");
await click("Cancel");
await expect.poll(snapshot).not.toContain('alertdialog "Move Ben to Research?"');
@@ -293,9 +293,9 @@ type BotRecord = {
expect(await messages(ben.id)).toEqual(transcript);
receipts.order = await cardOrder("Delivery");
const beforeArrange = await teamPosition("Delivery");
- receipts.cancelledArrange = await drag('[aria-label="Arrange Delivery team"]', { x: 45, y: 20 }, undefined, true);
+ receipts.cancelledArrange = await drag('[aria-label="Arrange Delivery department"]', { x: 45, y: 20 }, undefined, true);
expect(await teamPosition("Delivery")).toEqual(beforeArrange);
- receipts.arrange = await drag('[aria-label="Arrange Delivery team"]', { x: 12, y: 10 });
+ receipts.arrange = await drag('[aria-label="Arrange Delivery department"]', { x: 12, y: 10 });
await expect.poll(() => teamPosition("Delivery")).not.toEqual(beforeArrange);
const arranged = await teamPosition("Delivery");
const beforePan = await view();
@@ -319,7 +319,7 @@ type BotRecord = {
await expect.poll(async () => (await view()).scale).toBe(0.3);
const beforeWheelPan = await view();
await wheel(45, false);
- await expect.poll(async () => (await view()).y).toBeCloseTo(beforeWheelPan.y - 45, 4);
+ await expect.poll(async () => (await view()).y).toBeCloseTo(beforeWheelPan.y - 45, 3);
await click("Fit departments to view");
expect(await evaluate(`(() => {
const viewport = document.querySelector('[data-team-canvas]').getBoundingClientRect();
diff --git a/scripts/testing/team-computers-ui.e2e.test.ts b/scripts/testing/team-computers-ui.e2e.test.ts
index 3867aaaece..78fbf45e3f 100644
--- a/scripts/testing/team-computers-ui.e2e.test.ts
+++ b/scripts/testing/team-computers-ui.e2e.test.ts
@@ -6,7 +6,7 @@ import { expect, it } from "vitest";
import { resolveAgentBrowserBinary } from "../../server/browser-engine.ts";
import { waitForExit } from "../../server/testing/cleanup.ts";
import { runControlOmb } from "../control-omb.ts";
-import { UI_TOOLS_DIR } from "./control-omb-ui.ts";
+import { OPEN_SIDEBAR_TOOLS, UI_TOOLS_DIR } from "./control-omb-ui.ts";
import { fixtureApi } from "./preview-fixture.ts";
const ROOT = fileURLToPath(new URL("../..", import.meta.url));
@@ -53,7 +53,7 @@ type Computer = { id: string; name: string; section: string | null; state: strin
const record = async (id: string) => (await computers()).find(computer => computer.id === id);
const receipts = () => provider("GET", "/__fixture");
const focused = () => evaluate("document.activeElement?.getAttribute('aria-label') || document.activeElement?.textContent?.trim()");
- const openMap = async () => { await click("Tools"); await click("Team map"); await expect.poll(snapshot).toContain('region "Team canvas"'); };
+ const openMap = async () => { await evaluate(OPEN_SIDEBAR_TOOLS); await click("Team map"); await expect.poll(snapshot).toContain('region "Team canvas"'); };
await api("PATCH", `/api/bots/${fixture.botId}`, { name: "Ada", section: "Engineering", computer: "off" });
await api("POST", "/api/sidebar-sections", { name: "Research" });
await api("POST", "/api/bots", { name: "Ben", section: "Research", modelSelection: { instanceId: "claude", model: "claude-sonnet-5" } });
@@ -61,14 +61,14 @@ type Computer = { id: string; name: string; section: string | null; state: strin
await evaluate("location.reload(); true");
await expect.poll(snapshot, { timeout: 15_000 }).toContain("Actions for Ada");
await openMap();
- await click("Computers");
- await expect.poll(snapshot).toContain('complementary "Team computers"');
+ await click("Desktops");
+ await expect.poll(snapshot).toContain('complementary "Desktops"');
expect((await receipts()).calls.every((call: { method: string }) => call.method === "GET")).toBe(true);
- await click("Close computers");
+ await click("Close desktops");
// Native <summary> appears in AX but agent-browser does not assign a ref.
await evaluate("document.querySelector('summary[aria-label=\"Add to team map\"]').focus(); true");
await ui("press", "--keys", "Enter");
- await click("Cloud computer");
+ await click("Cloud desktop");
await expect.poll(() => evaluate("document.activeElement?.id")).toBe("canvas-computer-name");
expect(await snapshot()).toContain("Your Boat plan and usage charges apply");
expect(await evaluate("[...document.querySelectorAll('button')].find(button => button.textContent.trim() === 'Create cloud desktop')?.disabled")).toBe(true);
@@ -119,10 +119,10 @@ type Computer = { id: string; name: string; section: string | null; state: strin
await drag("Engineering");
await expect.poll(focused).toBe("Cancel");
await ui("press", "--keys", "Tab");
- expect(await focused()).toBe("Assign computer");
+ expect(await focused()).toBe("Assign desktop");
await ui("press", "--keys", "Enter");
await expect.poll(async () => (await record(machine.id))?.section).toBe("Engineering");
- await expect.poll(snapshot).toContain("Computer for Engineering team: Engineering desktop");
+ await expect.poll(snapshot).toContain("Desktop for Engineering department: Engineering desktop");
await drag("Research");
await expect.poll(snapshot).toContain("Unassign Engineering desktop from Engineering before moving");
expect((await record(machine.id))?.section).toBe("Engineering");
@@ -137,31 +137,31 @@ type Computer = { id: string; name: string; section: string | null; state: strin
};
await selectTeam("unassigned");
await expect.poll(snapshot).toContain('alertdialog "Unassign Engineering desktop?"');
- await click("Unassign computer");
+ await click("Unassign desktop");
await expect.poll(async () => (await record(machine.id))?.section).toBeNull();
await selectTeam("team:Research");
await expect.poll(snapshot).toContain('alertdialog "Assign Engineering desktop to Research?"');
- await click("Assign computer");
+ await click("Assign desktop");
await expect.poll(async () => (await record(machine.id))?.section).toBe("Research");
expect((await api("GET", "/api/bots?messages=10")).bots).toEqual(before);
expect(JSON.parse(readFileSync(join(fixture.dataDir, "team-computers.json"), "utf8")).computers)
.toContainEqual(expect.objectContaining({ id: machine.id, section: "Research", name: machine.name }));
// Wait for each destination before operating controls from the next view.
- await click("Close computers");
- await expect.poll(snapshot, { timeout: 10_000 }).not.toContain('complementary "Team computers"');
+ await click("Close desktops");
+ await expect.poll(snapshot, { timeout: 10_000 }).not.toContain('complementary "Desktops"');
await click("Open chat with Ben");
await expect.poll(snapshot, { timeout: 10_000 }).toContain('log "Conversation with Ben"');
- await click("Bot's computer");
+ await click("Bot's screen");
await expect.poll(snapshot, { timeout: 10_000 }).toContain("Ben's screen");
await expect.poll(snapshot, { timeout: 20_000, interval: 250 }).toContain("Uses Engineering desktop, the cloud desktop this department shares.");
expect(await snapshot()).not.toContain("Choose Cloud");
- await click("Open Team map");
+ expect(await evaluate("(() => { const action = [...document.querySelectorAll('[data-testid=place-action]')].find(button => button.textContent === 'Open Team map'); action?.click(); return Boolean(action); })()")).toBe(true);
expect((await receipts()).calls.filter((call: { method: string; path: string }) => call.method === "POST" && call.path === "/sandboxes")).toHaveLength(1);
await evaluate("location.reload(); true");
await expect.poll(snapshot, { timeout: 15_000 }).toContain("Actions for Ada");
await openMap();
- await expect.poll(snapshot).toContain("Computer for Research team: Engineering desktop");
- await click("Computer for Research team: Engineering desktop");
+ await expect.poll(snapshot).toContain("Desktop for Research department: Engineering desktop");
+ await click("Desktop for Research department: Engineering desktop");
await click("Open desktop");
await expect.poll(snapshot).toContain("Open secure desktop");
expect((await record(machine.id))?.held).toBe(true);
diff --git a/scripts/testing/team-lifecycle-ui.e2e.test.ts b/scripts/testing/team-lifecycle-ui.e2e.test.ts
index 48614ac8b7..6b70d396f4 100644
--- a/scripts/testing/team-lifecycle-ui.e2e.test.ts
+++ b/scripts/testing/team-lifecycle-ui.e2e.test.ts
@@ -8,7 +8,7 @@ import { waitForExit } from "../../server/testing/cleanup.ts";
import { runControlOmb } from "../control-omb.ts";
import { request } from "../mcp-server.ts";
import { mountPreview, type MountedPreview } from "./preview-fixture.ts";
-import { UI_TOOLS_DIR } from "./control-omb-ui.ts";
+import { OPEN_SIDEBAR_TOOLS, UI_TOOLS_DIR } from "./control-omb-ui.ts";
const ROOT = fileURLToPath(new URL("../..", import.meta.url));
const binary = resolveAgentBrowserBinary({ dataDir: UI_TOOLS_DIR, env: process.env });
@@ -110,7 +110,7 @@ if (!enabled) console.log("skipping team lifecycle UI e2e: set OMB_UI_E2E=1 to i
await type("Department name", "Delivery");
await click("Save name");
await expect.poll(snapshot).toContain('button "Delivery"');
- await click("Tools");
+ await ui("eval", "--js", OPEN_SIDEBAR_TOOLS);
await click("Team map");
await manage("Delivery");
await click("Move bots to Delivery");
@@ -157,15 +157,15 @@ if (!enabled) console.log("skipping team lifecycle UI e2e: set OMB_UI_E2E=1 to i
await ui("eval", "--js", "location.reload(); true");
await expect.poll(snapshot, { timeout: 15_000 }).toContain('button "Delivery"');
- await click("Tools");
+ await ui("eval", "--js", OPEN_SIDEBAR_TOOLS);
await click("Team map");
await manage("Delivery");
expect(await snapshot()).toContain("Edit Delivery shared instructions");
// A second fixture client moves the bots out. SSE must keep the empty
// team visible and make rename/delete available without a reload.
await api("/api/sidebar-sections", "POST", { name: "", botIds: [a.id, b.id, created!.id] });
- await expect.poll(snapshot, { timeout: 10_000 }).toContain("Rename Delivery team");
- await click("Rename Delivery team");
+ await expect.poll(snapshot, { timeout: 10_000 }).toContain("Rename Delivery department");
+ await click("Rename Delivery department");
await type("Department name", "Launch");
await click("Save name");
await manage("Launch");
@@ -213,7 +213,7 @@ if (!enabled) console.log("skipping team lifecycle UI e2e: set OMB_UI_E2E=1 to i
// requiring the team map. Cancel and Escape must leave its brief intact.
await api("/api/sidebar-sections", "POST", { name: "Sidebar empty" });
await api("/api/section-context?section=Sidebar%20empty", "PUT", { text: "Keep this until deletion is confirmed." });
- await click("Delete Sidebar empty section");
+ await click("Delete Sidebar empty department");
await expect.poll(snapshot).toContain('alertdialog "Delete Sidebar empty department?"');
expect(await focused()).toBe("Cancel");
await ui("press", "--keys", "Shift+Tab");
@@ -221,14 +221,14 @@ if (!enabled) console.log("skipping team lifecycle UI e2e: set OMB_UI_E2E=1 to i
await ui("press", "--keys", "Tab");
expect(await focused()).toBe("Cancel");
await ui("press", "--keys", "Escape");
- await expect.poll(focused).toBe("Delete Sidebar empty section");
+ await expect.poll(focused).toBe("Delete Sidebar empty department");
expect((await api("/api/sidebar-sections")).sections).toContain("Sidebar empty");
expect((await api("/api/section-context?section=Sidebar%20empty")).text).toBe("Keep this until deletion is confirmed.");
- await click("Delete Sidebar empty section");
+ await click("Delete Sidebar empty department");
await click("Cancel");
- await expect.poll(focused).toBe("Delete Sidebar empty section");
+ await expect.poll(focused).toBe("Delete Sidebar empty department");
expect((await api("/api/sidebar-sections")).sections).toContain("Sidebar empty");
- await click("Delete Sidebar empty section");
+ await click("Delete Sidebar empty department");
await click("Delete department");
await expect.poll(async () => (await api("/api/sidebar-sections")).sections.includes("Sidebar empty")).toBe(false);
await expect.poll(() => evaluate('Boolean(document.querySelector("[data-sidebar-section-id=\\"section:Sidebar empty\\"]"))')).toBe(false);
@@ -241,7 +241,7 @@ if (!enabled) console.log("skipping team lifecycle UI e2e: set OMB_UI_E2E=1 to i
const transcript = (await control("messages", "--bot", a.id, "--limit", "10") as any).messages;
expect(transcript.length).toBeGreaterThan(0);
const deleteSectionByIcon = async (name: string) => {
- await click(`Delete ${name} section`);
+ await click(`Delete ${name} department`);
await expect.poll(snapshot).toContain(`alertdialog "Delete ${name} department?"`);
expect(await focused()).toBe("Cancel");
expect(await evaluate("document.querySelector('[role=alertdialog]')?.textContent")).toContain(
diff --git a/scripts/testing/team-map-computers-ui.e2e.test.ts b/scripts/testing/team-map-computers-ui.e2e.test.ts
index c697adc1b8..09f693b45b 100644
--- a/scripts/testing/team-map-computers-ui.e2e.test.ts
+++ b/scripts/testing/team-map-computers-ui.e2e.test.ts
@@ -77,7 +77,7 @@ type Receipts = { calls: Array<{ method: string; path: string }>; shots: Record<
await ui("screenshot", "--out", `${fixture.logPath}.team-map-computers.png`);
// The switch hides them, and the choice survives a reload.
- expect(await press("Show computers")).toBe(true);
+ expect(await press("Show screens")).toBe(true);
await expect.poll(async () => (await screens()).length).toBe(0);
await evaluate("location.reload(); true");
await openMap();
@@ -87,7 +87,7 @@ type Receipts = { calls: Array<{ method: string; path: string }>; shots: Record<
const quiet = await shots();
await new Promise((resolve) => setTimeout(resolve, 15_000));
expect(await shots()).toBe(quiet);
- expect(await press("Show computers")).toBe(true);
+ expect(await press("Show screens")).toBe(true);
await expect.poll(async () => (await screens()).length, { timeout: 20_000 }).toBe(14);
// The map's composer: nothing goes out without a tag; each tagged bot gets one normal message in its own chat.
@@ -115,7 +115,7 @@ type Receipts = { calls: Array<{ method: string; path: string }>; shots: Record<
await expect.poll(snapshot).toContain("Sent to");
// Clicking a computer opens that bot's computer view beside the map.
- expect(await press("Open Theo's computer (Working)")).toBe(true);
+ expect(await press("Open Theo's desktop (Working)")).toBe(true);
await expect.poll(snapshot, { timeout: 10_000 }).toContain("Theo's screen");
expect(await snapshot()).toContain('region "Team canvas"');
Object.assign(evidence, { receipts: await receipts(), screens: await screens() });
diff --git a/scripts/testing/team-template-ui.e2e.test.ts b/scripts/testing/team-template-ui.e2e.test.ts
index bfb3bd2af7..ac194efbb4 100644
--- a/scripts/testing/team-template-ui.e2e.test.ts
+++ b/scripts/testing/team-template-ui.e2e.test.ts
@@ -44,6 +44,8 @@ describe("additive template imports in the real renderer", () => {
await control("send", "--bot", info!.botId, "--text", "Keep this original conversation after importing templates.");
expect(await control("wait", "--bot", info!.botId, "--timeout", "30")).toMatchObject({ status: "settled" });
const original = await api("/api/bots");
+ // Viewing a chat marks it read at any moment; an import must leave everything else as it was.
+ const withoutReadState = (value: unknown) => JSON.parse(JSON.stringify(value, (key, field) => key === "unread" || key === "lastReadMessageId" ? undefined : field));
const transcript = await control("messages", "--bot", info!.botId, "--limit", "10");
const manifest = { format: "openmaus.team", version: 2, team: { name: "Sales crew", members: [
{ key: "researcher", name: "Lead finder", appearance: { color: "cyan" } },
@@ -74,14 +76,14 @@ describe("additive template imports in the real renderer", () => {
// Exercise the file input's actual change handler, not the OS picker.
await evaluate(`(() => { const input = document.querySelector('[role=dialog] input[type=file]'); const transfer = new DataTransfer(); transfer.items.add(new File([JSON.stringify(window.templateFixture)], 'sales.mausteam.json', { type: 'application/json' })); input.files = transfer.files; input.dispatchEvent(new Event('change', { bubbles: true })); return true; })()`);
}
- await expect.poll(snapshot, { timeout: 10_000 }).toContain("Adds a new team for Sales crew");
+ await expect.poll(snapshot, { timeout: 10_000 }).toContain("Adds a new department for Sales crew");
await click("Add team");
const section = source === "library" ? "Sales crew" : "Sales crew 2";
await expect.poll(snapshot, { timeout: 10_000 }).toContain(`button "${section}"`);
const current = await api("/api/bots");
expect(current.bots.filter((bot: { section?: string }) => bot.section === section)).toHaveLength(2);
- for (const bot of original.bots) expect(current.bots.find((value: { id: string }) => value.id === bot.id)).toEqual(bot);
- expect(await control("messages", "--bot", info!.botId, "--limit", "10")).toEqual(transcript);
+ for (const bot of original.bots) expect(withoutReadState(current.bots.find((value: { id: string }) => value.id === bot.id))).toEqual(withoutReadState(bot));
+ expect(withoutReadState(await control("messages", "--bot", info!.botId, "--limit", "10"))).toEqual(withoutReadState(transcript));
expect(await snapshot()).toContain('button "Existing work"');
expect(await snapshot()).toContain('button "Personal"');
}
diff --git a/scripts/testing/tool-selection-ui.e2e.test.ts b/scripts/testing/tool-selection-ui.e2e.test.ts
index 6f84a4a842..de12729c8f 100644
--- a/scripts/testing/tool-selection-ui.e2e.test.ts
+++ b/scripts/testing/tool-selection-ui.e2e.test.ts
@@ -72,10 +72,10 @@ interface SavedBot { id: string; name: string; toolScope?: { allow?: string[]; d
expect(await scope()).toEqual(selected);
await fill("Allow (one per line)", "");
expect(await snapshot()).toContain("An empty Allow list selects no tools");
- expect(await snapshot()).toContain("This engine cannot limit native tools");
+ expect(await snapshot()).toContain("This AI cannot limit native tools");
await click("Save tool selection");
await expect.poll(() => scope()).toEqual({ allow: [], deny: ["mcp:mail:send"] });
- expect(await snapshot()).toContain("No tools selected");
+ await expect.poll(snapshot).toContain("No tools selected");
await mode("all"); await click("Save tool selection");
await expect.poll(() => scope()).toBeUndefined();
diff --git a/scripts/testing/trust-controls-ui.e2e.test.ts b/scripts/testing/trust-controls-ui.e2e.test.ts
index 5cfda37f05..e027f83fad 100644
--- a/scripts/testing/trust-controls-ui.e2e.test.ts
+++ b/scripts/testing/trust-controls-ui.e2e.test.ts
@@ -66,7 +66,7 @@ describe("trust controls in the real renderer", () => {
await runControlOmb(["wait", "--bot", bot.id, "--timeout", "20", "--url", info.url]);
await expect.poll(snapshot, { timeout: 10_000 }).toContain("Ran a command");
await ui("screenshot", "--out", `${info.logPath}.activity.png`);
- await click("Close Activity");
+ await click("Close activity");
const interactive = await ui("snapshot", "--interactive");
const profile = Object.entries(interactive.refs as Record<string, { role: string; name: string }>)
diff --git a/scripts/testing/usage-details-ui.e2e.test.ts b/scripts/testing/usage-details-ui.e2e.test.ts
index 99311ca455..0fef1128d3 100644
--- a/scripts/testing/usage-details-ui.e2e.test.ts
+++ b/scripts/testing/usage-details-ui.e2e.test.ts
@@ -65,16 +65,16 @@ if (!enabled) console.log("skipping usage details UI: set OMB_UI_E2E=1 to instal
return { viewport: innerWidth, scroll: document.documentElement.scrollWidth,
menu: rect('[role=menu][aria-label=More]'), editor: rect('.mention-editor'),
row: rect('[data-composer-row]'), controls: rect('[data-composer-actions]'),
- threads: Boolean(document.querySelector('button[aria-label="All threads"]')) };
+ wraps: getComputedStyle(document.querySelector('[data-composer-row]')).flexWrap === 'wrap' };
})()`);
expect(await evaluate("document.querySelectorAll('[data-chathead-controls] > div').length")).toBeLessThan(6);
expect(layout.scroll).toBeLessThanOrEqual(width);
expect(layout.viewport).toBe(width);
expect(layout.menu.left).toBeGreaterThanOrEqual(0);
expect(layout.menu.right).toBeLessThanOrEqual(width);
- expect(layout.threads).toBe(true);
expect(layout.controls.width).toBeGreaterThan(0);
- if (layout.row.width < 480) {
+ // Simple mode keeps the editor and its controls on one row at every width.
+ if (layout.wraps && layout.row.width < 480) {
expect(layout.editor.width).toBeGreaterThanOrEqual(layout.row.width - 1);
expect(layout.editor.bottom).toBeLessThanOrEqual(layout.controls.top);
}
diff --git a/server/routes/sidebar-sections.ts b/server/routes/sidebar-sections.ts
index 4d5ff7424a..c3d039e374 100644
--- a/server/routes/sidebar-sections.ts
+++ b/server/routes/sidebar-sections.ts
@@ -53,8 +53,8 @@ export function createSidebarSectionRoutes(deps: SidebarSectionRouteDeps): Route
}
const result = store.updateTeamMembers(section, parsed.data.addBotIds, parsed.data.removeBotIds);
if (!result.ok) return json(res, result.reason === "unavailable" ? 404 : 409, { error:
- result.reason === "chief-conflict" ? "A team can have only one Chief of Staff. Change the Chief before moving this bot."
- : result.reason === "membership-changed" ? "Team membership changed. Reopen the dialog and try again."
+ result.reason === "chief-conflict" ? "A department can have only one Chief of Staff. Change the Chief before moving this bot."
+ : result.reason === "membership-changed" ? "Department membership changed. Reopen the dialog and try again."
: "One or more bots are unavailable" });
return json(res, 200, { sections: store.sections, bots: result.bots.map(wireBot) });
}