mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 05:10:44 +00:00
test: tighten browser doctor warning assertion
This commit is contained in:
@@ -8,6 +8,15 @@ vi.mock("../plugin-sdk/facade-loader.js", () => ({
|
||||
loadBundledPluginPublicSurfaceModuleSync,
|
||||
}));
|
||||
|
||||
function requireFirstNoteCall(noteFn: ReturnType<typeof vi.fn>): unknown[] {
|
||||
const call = noteFn.mock.calls[0];
|
||||
expect(call).toBeDefined();
|
||||
if (!call) {
|
||||
throw new Error("expected browser doctor note");
|
||||
}
|
||||
return call;
|
||||
}
|
||||
|
||||
describe("doctor browser facade", () => {
|
||||
beforeEach(() => {
|
||||
loadBundledPluginPublicSurfaceModuleSync.mockReset();
|
||||
@@ -45,8 +54,9 @@ describe("doctor browser facade", () => {
|
||||
|
||||
await expect(noteChromeMcpBrowserReadiness({}, { noteFn })).resolves.toBeUndefined();
|
||||
expect(noteFn).toHaveBeenCalledTimes(1);
|
||||
expect(String(noteFn.mock.calls[0]?.[0])).toContain("Browser health check is unavailable");
|
||||
expect(String(noteFn.mock.calls[0]?.[0])).toContain("missing browser doctor facade");
|
||||
expect(noteFn.mock.calls[0]?.[1]).toBe("Browser");
|
||||
const noteCall = requireFirstNoteCall(noteFn);
|
||||
expect(String(noteCall[0])).toContain("Browser health check is unavailable");
|
||||
expect(String(noteCall[0])).toContain("missing browser doctor facade");
|
||||
expect(noteCall[1]).toBe("Browser");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user