mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
test: tighten onboarding doctor assertions
This commit is contained in:
@@ -22,10 +22,13 @@ describe("runDoctorConfigPreflight", () => {
|
||||
|
||||
expect(preflight.snapshot.valid).toBe(false);
|
||||
expect(preflight.snapshot.legacyIssues.map((issue) => issue.path)).toContain("memorySearch");
|
||||
expect((preflight.baseConfig as { memorySearch?: unknown }).memorySearch).toMatchObject({
|
||||
provider: "local",
|
||||
fallback: "none",
|
||||
});
|
||||
const memorySearch = (
|
||||
preflight.baseConfig as {
|
||||
memorySearch?: { provider?: unknown; fallback?: unknown };
|
||||
}
|
||||
).memorySearch;
|
||||
expect(memorySearch?.provider).toBe("local");
|
||||
expect(memorySearch?.fallback).toBe("none");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -218,11 +218,9 @@ describe("noteDevicePairingHealth", () => {
|
||||
healthOk: true,
|
||||
});
|
||||
|
||||
expect(callGatewayMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
method: "device.pair.list",
|
||||
}),
|
||||
);
|
||||
expect(callGatewayMock).toHaveBeenCalledOnce();
|
||||
const [gatewayRequest] = callGatewayMock.mock.calls[0] ?? [];
|
||||
expect(gatewayRequest?.method).toBe("device.pair.list");
|
||||
expect(noteMock).toHaveBeenCalledTimes(1);
|
||||
expect(String(noteMock.mock.calls[0]?.[0] ?? "")).toContain("req-gateway-1");
|
||||
});
|
||||
|
||||
@@ -145,12 +145,10 @@ describe("promptCustomApiConfig", () => {
|
||||
|
||||
await runPromptCustomApi(prompter);
|
||||
|
||||
expect(prompter.text).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
message: "API Base URL",
|
||||
initialValue: undefined,
|
||||
}),
|
||||
const apiBaseUrlCall = prompter.text.mock.calls.find(
|
||||
([options]) => options.message === "API Base URL",
|
||||
);
|
||||
expect(apiBaseUrlCall?.[0].initialValue).toBeUndefined();
|
||||
});
|
||||
|
||||
it("retries when verification fails", async () => {
|
||||
|
||||
@@ -104,7 +104,7 @@ describe("openUrl", () => {
|
||||
expect(mocks.runCommandWithTimeout).toHaveBeenCalledTimes(1);
|
||||
const [argv, options] = mocks.runCommandWithTimeout.mock.calls[0] ?? [];
|
||||
expect(argv).toEqual([rundll32, "url.dll,FileProtocolHandler", url]);
|
||||
expect(options).toMatchObject({ timeoutMs: 5_000 });
|
||||
expect(options?.timeoutMs).toBe(5_000);
|
||||
expect(options?.windowsVerbatimArguments).toBeUndefined();
|
||||
|
||||
platformSpy.mockRestore();
|
||||
|
||||
@@ -184,6 +184,6 @@ describe("setupSkills", () => {
|
||||
await setupSkills({} as OpenClawConfig, "/tmp/ws", runtime, prompter);
|
||||
|
||||
const brewNote = notes.find((n) => n.title === "Homebrew recommended");
|
||||
expect(brewNote).toMatchObject({ title: "Homebrew recommended" });
|
||||
expect(brewNote?.title).toBe("Homebrew recommended");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user