mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 07:17:40 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user