refactor: rename to openclaw

This commit is contained in:
Peter Steinberger
2026-01-30 03:15:10 +01:00
parent 4583f88626
commit 9a7160786a
2357 changed files with 16688 additions and 16788 deletions

View File

@@ -5,15 +5,15 @@ import type { BrowserServerState } from "./server-context.js";
vi.mock("./chrome.js", () => ({
isChromeCdpReady: vi.fn(async () => true),
isChromeReachable: vi.fn(async () => true),
launchClawdChrome: vi.fn(async () => {
launchOpenClawChrome: vi.fn(async () => {
throw new Error("unexpected launch");
}),
resolveClawdUserDataDir: vi.fn(() => "/tmp/clawd"),
stopClawdChrome: vi.fn(async () => {}),
resolveOpenClawUserDataDir: vi.fn(() => "/tmp/openclaw"),
stopOpenClawChrome: vi.fn(async () => {}),
}));
function makeState(
profile: "remote" | "clawd",
profile: "remote" | "openclaw",
): BrowserServerState & { profiles: Map<string, { lastTargetId?: string | null }> } {
return {
// biome-ignore lint/suspicious/noExplicitAny: test stub
@@ -38,7 +38,7 @@ function makeState(
cdpPort: 443,
color: "#00AA00",
},
clawd: { cdpPort: 18800, color: "#FF4500" },
openclaw: { cdpPort: 18800, color: "#FF4500" },
},
},
profiles: new Map(),
@@ -272,12 +272,12 @@ describe("browser server-context tab selection state", () => {
global.fetch = fetchMock;
const { createBrowserRouteContext } = await import("./server-context.js");
const state = makeState("clawd");
const state = makeState("openclaw");
const ctx = createBrowserRouteContext({ getState: () => state });
const clawd = ctx.forProfile("clawd");
const openclaw = ctx.forProfile("openclaw");
const opened = await clawd.openTab("https://created.example");
const opened = await openclaw.openTab("https://created.example");
expect(opened.targetId).toBe("CREATED");
expect(state.profiles.get("clawd")?.lastTargetId).toBe("CREATED");
expect(state.profiles.get("openclaw")?.lastTargetId).toBe("CREATED");
});
});