Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(spaces-web): skip the app tests that need the wasm core when it is not built (CUA-3248) (#6473)

injaneityca144cfe6009
diff --git a/apps/cua-spaces-web/src/__tests__/agent-failure.test.tsx b/apps/cua-spaces-web/src/__tests__/agent-failure.test.tsx
index 3f0111285d..9fa5fbc017 100644
--- a/apps/cua-spaces-web/src/__tests__/agent-failure.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/agent-failure.test.tsx
@@ -10,6 +10,7 @@ import { act, cleanup, fireEvent, waitFor } from "@testing-library/react";
import { afterEach, describe, expect, it } from "vitest";
import { DEMO_THREAD_SPACE } from "@/bridge/adapters/demo/thread";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
import { mountApp, stubBrowserApis } from "./app-harness";
afterEach(cleanup);
@@ -23,7 +24,7 @@ const failureReply = (who: string) => qa("[data-entry]").find((e) => e.querySele
const host = { failsCreates: false, listsGhost: false, demo: { threadAuthFailed: true } };
describe("an agent that is not connected", () => {
- it("answers in plain words with Connect and Retry, never as the raw error, and the person's message is not marked Failed", async () => {
+ it.skipIf(!wasmBuilt)("answers in plain words with Connect and Retry, never as the raw error, and the person's message is not marked Failed", async () => {
await mountApp(path, host);
const failed = await waitFor(
() => {
diff --git a/apps/cua-spaces-web/src/__tests__/agent-identity.test.tsx b/apps/cua-spaces-web/src/__tests__/agent-identity.test.tsx
index 8e617036e5..c4b1704649 100644
--- a/apps/cua-spaces-web/src/__tests__/agent-identity.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/agent-identity.test.tsx
@@ -18,6 +18,7 @@ import { APP_MARKS } from "@/components/agents/harness-mark";
import { HARNESSES, harnessInfo } from "@/components/space-thread/harness-marks";
import { joinedWhen, reportedHarness } from "@/components/space-thread/identity";
import { buildRoster } from "@/components/space-thread/roster";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
import { mountApp, stubBrowserApis } from "./app-harness";
afterEach(cleanup);
@@ -142,7 +143,7 @@ describe("an agent's identity", () => {
expect(memberIdentity({ handle: "x", owner: ADA, icon: "https://example.com/i.png" })?.icon).toBe("https://example.com/i.png");
});
- it("opens the card from the name: Grace's Claude Code, in one line, with the rest under Details", async () => {
+ it.skipIf(!wasmBuilt)("opens the card from the name: Grace's Claude Code, in one line, with the rest under Details", async () => {
await app();
const card = await openCard("claude");
expect(card.querySelector("[data-card-title]")?.textContent).toBe("Claude Code");
@@ -164,21 +165,21 @@ describe("an agent's identity", () => {
expect(card.textContent).not.toContain("checked by Cua");
});
- it("the card of your own Hermes, started here: run by you in this Space", async () => {
+ it.skipIf(!wasmBuilt)("the card of your own Hermes, started here: run by you in this Space", async () => {
await app();
const card = await openCard("hermes");
expect(line(card)).toBe("Run by you in this Space, uses Anthropic");
expect(await details(card)).toMatchObject({ Handle: "@hermes", Runs: "Hermes Agent 0.9.2", Joined: expect.stringMatching(/^Started in this Space/) });
});
- it("a look-alike's card: its own owner, its own handle, Runs not reported", async () => {
+ it.skipIf(!wasmBuilt)("a look-alike's card: its own owner, its own handle, Runs not reported", async () => {
await app({ threadLookalike: true });
const card = await openCard("claude-2");
expect(line(card)).toMatch(/^Run by Linus on linus-thinkpad/);
expect(await details(card)).toMatchObject({ Handle: "@claude-2", Runs: "Not reported" });
});
- it("Remove from Space: the owner sees it and removing leaves its posts with their mark and owner", async () => {
+ it.skipIf(!wasmBuilt)("Remove from Space: the owner sees it and removing leaves its posts with their mark and owner", async () => {
await app({ threadLookalike: true });
const card = await openCard("claude-2");
const remove = card.querySelector<HTMLElement>("[data-remove-agent='claude-2']")!;
@@ -211,7 +212,7 @@ describe("an agent's identity", () => {
expect(roster([], { me: ADA.id, role: "owner" }).canRemove(identity({ owner: grace }))).toBe(true);
});
- it("a member's card has no Remove for someone else's agent", async () => {
+ it.skipIf(!wasmBuilt)("a member's card has no Remove for someone else's agent", async () => {
await app({ threadRole: "member" });
const card = await openCard("claude");
expect(card.querySelector("[data-remove-agent]")).toBeNull();
diff --git a/apps/cua-spaces-web/src/__tests__/agents-chat.test.tsx b/apps/cua-spaces-web/src/__tests__/agents-chat.test.tsx
index c8cd31ef5b..242cf5cb22 100644
--- a/apps/cua-spaces-web/src/__tests__/agents-chat.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/agents-chat.test.tsx
@@ -42,7 +42,7 @@ const click = async (el: HTMLElement) => {
const open = (search = "", demo: Record<string, unknown> = {}) => mountApp(`/agents${search}`, { failsCreates: false, listsGhost: false, demo });
describe("the Agents tab", () => {
- it("lists every agent once, Needs you pinned, running first, with owners and unread", async () => {
+ it.skipIf(!wasmBuilt)("lists every agent once, Needs you pinned, running first, with owners and unread", async () => {
await open();
await found(`[data-chat='${CODEX}']`);
// Needs you: Hermes's tag, Codex's question, Claude Code's push.
@@ -60,7 +60,7 @@ describe("the Agents tab", () => {
expect(q(`[data-chat='${CODEX}'] [data-owner-badge]`)?.dataset.ownerBadge).toBe("acct_ada");
});
- it("one agent in two Spaces: All merges them with Space labels; the switch narrows to one", async () => {
+ it.skipIf(!wasmBuilt)("one agent in two Spaces: All merges them with Space labels; the switch narrows to one", async () => {
await open(`?agent=${encodeURIComponent(HERMES)}`);
const dm = await found(`[data-dm='${HERMES}'][data-dm-space='all']`);
await waitFor(() => expect(dm.querySelectorAll("[data-dm-space-label]").length).toBeGreaterThan(1));
@@ -79,7 +79,7 @@ describe("the Agents tab", () => {
expect(q("[data-dm-target]")?.dataset.dmTarget).toBe("relay:linux-box/ubuntu-build");
});
- it("sending is an @mention task in the Space the composer names; members see it", async () => {
+ it.skipIf(!wasmBuilt)("sending is an @mention task in the Space the composer names; members see it", async () => {
await open(`?agent=${encodeURIComponent(CODEX)}`);
await found(`[data-dm='${CODEX}']`);
expect(q("[data-dm-members-see]")?.textContent).toBe("Members see it");
@@ -100,7 +100,7 @@ describe("the Agents tab", () => {
await waitFor(() => expect(task.dataset.taskState).toBe("done"), { timeout: 5000 });
});
- it("a teammate's agent at work: the working line with Watch, its push waiting for approval", async () => {
+ it.skipIf(!wasmBuilt)("a teammate's agent at work: the working line with Watch, its push waiting for approval", async () => {
await open(`?agent=${encodeURIComponent(CLAUDE)}`);
const line = await found("[data-dm-working]");
expect(line.textContent).toContain("Bumping the retry timeout in ubuntu-build");
@@ -108,7 +108,7 @@ describe("the Agents tab", () => {
expect(q("[data-dm-open-space]")?.textContent).toContain("ubuntu-build");
});
- it("when only its owner may task it, the composer says so and offers the Space", async () => {
+ it.skipIf(!wasmBuilt)("when only its owner may task it, the composer says so and offers the Space", async () => {
await open(`?agent=${encodeURIComponent("acct_grace/hermes/hermes")}`, { threadRole: "member" });
const locked = await found("[data-dm-locked]");
expect(locked.textContent).toContain("can give Hermes tasks.");
@@ -124,7 +124,7 @@ describe("the Agents tab", () => {
expect(q("[data-agents-show-all]")).not.toBeNull();
});
- it("Connect on the empty page shows the app's real mark and opens Connectors at its row, connecting nothing", async () => {
+ it.skipIf(!wasmBuilt)("Connect on the empty page shows the app's real mark and opens Connectors at its row, connecting nothing", async () => {
const { router } = await open("", { noThread: true, agents: "unset" });
const row = await found('[data-agents-empty-row^="connect-mac-"]');
expect(row.querySelector("[data-app-mark]")).not.toBeNull();
@@ -145,7 +145,7 @@ describe("the Agents tab", () => {
expect(q("[data-add-agent='pick'] [aria-label='Space']")).not.toBeNull();
});
- it("ⓘ shows who the agent is in each of its Spaces", async () => {
+ it.skipIf(!wasmBuilt)("ⓘ shows who the agent is in each of its Spaces", async () => {
await open(`?agent=${encodeURIComponent(HERMES)}`);
await click(await found("[data-dm-info]"));
const page = await found(`[data-agent-page='${HERMES}']`);
@@ -154,7 +154,7 @@ describe("the Agents tab", () => {
expect(page.querySelector("[data-agent-page-all]")).not.toBeNull();
});
- it("the thread's card links to the agent's DM (Activity, under Details)", async () => {
+ it.skipIf(!wasmBuilt)("the thread's card links to the agent's DM (Activity, under Details)", async () => {
await mountApp(`/spaces/${encodeURIComponent("relay:linux-box/ubuntu-build")}`, { failsCreates: false, listsGhost: false });
const name = await found("[data-author-name='claude']");
await click(name);
diff --git a/apps/cua-spaces-web/src/__tests__/agents-populate-timing.test.tsx b/apps/cua-spaces-web/src/__tests__/agents-populate-timing.test.tsx
index 713cc61274..34de83982f 100644
--- a/apps/cua-spaces-web/src/__tests__/agents-populate-timing.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/agents-populate-timing.test.tsx
@@ -11,6 +11,7 @@
import { cleanup } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
import { mountApp, stubBrowserApis } from "./app-harness";
afterEach(cleanup);
@@ -64,7 +65,7 @@ async function visit(label: string): Promise<Record<string, number | null>> {
}
}
-describe("the Agents page on a busy account", () => {
+describe.skipIf(!wasmBuilt)("the Agents page on a busy account", () => {
it("shows rows as their Spaces answer, not when the slowest one does", async () => {
const t = await visit("cold");
expect(t["codex row"], "first row").toBeDefined();
diff --git a/apps/cua-spaces-web/src/__tests__/agents-populate.test.tsx b/apps/cua-spaces-web/src/__tests__/agents-populate.test.tsx
index 828ab5cd2b..3dea9ee6b9 100644
--- a/apps/cua-spaces-web/src/__tests__/agents-populate.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/agents-populate.test.tsx
@@ -9,6 +9,7 @@
import { act, cleanup, fireEvent, waitFor } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
import { mountApp, stubBrowserApis } from "./app-harness";
afterEach(cleanup);
@@ -31,7 +32,7 @@ const found = (s: string, timeout = 5000) =>
{ timeout },
);
-describe("the Agents page while Spaces are slow", () => {
+describe.skipIf(!wasmBuilt)("the Agents page while Spaces are slow", () => {
it("draws the Spaces that answered and says it is still checking the one that has not", async () => {
const t0 = Date.now();
await mountApp("/agents", {
diff --git a/apps/cua-spaces-web/src/__tests__/space-header.test.tsx b/apps/cua-spaces-web/src/__tests__/space-header.test.tsx
index 4aa35974a4..31a0f6e370 100644
--- a/apps/cua-spaces-web/src/__tests__/space-header.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/space-header.test.tsx
@@ -15,6 +15,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
import { DEMO_THREAD_SPACE } from "@/bridge/adapters/demo/thread";
import { SpaceHeader, type HeaderPower } from "@/components/space-detail/space-header";
import { TooltipProvider } from "@/components/ui/tooltip";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
import { mountApp, stubBrowserApis } from "./app-harness";
afterEach(cleanup);
@@ -127,7 +128,7 @@ describe("the call layout's surfaces", () => {
expect(field.className).not.toMatch(/(^|\s)border(\s|$)/);
});
- it("the tip sits flush on the stage and the rail: no bottom margin under it", async () => {
+ it.skipIf(!wasmBuilt)("the tip sits flush on the stage and the rail: no bottom margin under it", async () => {
await mountApp(path, { failsCreates: false, listsGhost: false });
await waitFor(() => expect(q("[data-call-layout] [data-tip]")).not.toBeNull(), { timeout: 4000 });
const tip = q("[data-call-layout] [data-tip]")!;
diff --git a/apps/cua-spaces-web/src/__tests__/space-thread.test.tsx b/apps/cua-spaces-web/src/__tests__/space-thread.test.tsx
index bb41f75896..3eaadcf4f6 100644
--- a/apps/cua-spaces-web/src/__tests__/space-thread.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/space-thread.test.tsx
@@ -10,6 +10,7 @@ import { act, cleanup, fireEvent, waitFor } from "@testing-library/react";
import { afterEach, describe, expect, it } from "vitest";
import { DEMO_THREAD_SPACE } from "@/bridge/adapters/demo/thread";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
import { mountApp, stubBrowserApis } from "./app-harness";
afterEach(cleanup);
@@ -68,7 +69,7 @@ describe("a Space's thread", () => {
expect(q("[data-presence]")).toBeNull();
});
- it("gives an agent a task with @: the picker, the pick, the post, and the agent's answer", async () => {
+ it.skipIf(!wasmBuilt)("gives an agent a task with @: the picker, the pick, the post, and the agent's answer", async () => {
await mountApp(path, { failsCreates: false, listsGhost: false });
const box = await waitFor(() => {
const el = q("[data-composer]") as HTMLTextAreaElement | null;
@@ -202,7 +203,7 @@ describe("a Space's thread", () => {
act(() => closeNetworkSheet());
});
- it("shows a window on the stage when it is picked, and a post made then says where it was sent from", async () => {
+ it.skipIf(!wasmBuilt)("shows a window on the stage when it is picked, and a post made then says where it was sent from", async () => {
const { demo } = await mountApp(path, { failsCreates: false, listsGhost: false });
const firefox = await waitFor(() => {
const el = q("[data-stream-window='w-firefox']");
@@ -276,7 +277,7 @@ describe("a Space's thread", () => {
expect(qa('[data-approval-state="open"] button:not([data-author-name]):not([data-profile-trigger])')).toHaveLength(0);
});
- it("says whose keys a task runs on, and shows rights read-only to a member", async () => {
+ it.skipIf(!wasmBuilt)("says whose keys a task runs on, and shows rights read-only to a member", async () => {
await mountApp(path, { failsCreates: false, listsGhost: false, demo: { threadRole: "member" } });
await waitFor(() => expect(qa("[data-entry-footnote]").length).toBeGreaterThan(0), { timeout: 4000 });
// Grace owns the Space here: Linus's task runs on her keys, hers on nobody else's.
@@ -289,7 +290,7 @@ describe("a Space's thread", () => {
expect(q("[data-agent-right]")).toBeNull();
});
- it("lets the owner change who can task an agent", async () => {
+ it.skipIf(!wasmBuilt)("lets the owner change who can task an agent", async () => {
await mountApp(path, { failsCreates: false, listsGhost: false });
await openRailCard("hermes");
await waitFor(() => expect(q("[data-agent-rights='hermes'] [data-agent-right='task'] button")).not.toBeNull());