mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 09:18:38 +00:00
test: isolate doctor allowFrom migration assertions from unrelated checks
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import {
|
import {
|
||||||
createDoctorRuntime,
|
createDoctorRuntime,
|
||||||
findLegacyGatewayServices,
|
findLegacyGatewayServices,
|
||||||
@@ -17,6 +17,54 @@ import {
|
|||||||
|
|
||||||
const DOCTOR_MIGRATION_TIMEOUT_MS = 20_000;
|
const DOCTOR_MIGRATION_TIMEOUT_MS = 20_000;
|
||||||
|
|
||||||
|
vi.mock("./doctor-completion.js", () => ({
|
||||||
|
doctorShellCompletion: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-gateway-daemon-flow.js", () => ({
|
||||||
|
maybeRepairGatewayDaemon: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-gateway-health.js", () => ({
|
||||||
|
checkGatewayHealth: vi.fn().mockResolvedValue({ healthOk: false }),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-memory-search.js", () => ({
|
||||||
|
noteMemorySearchHealth: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-platform-notes.js", () => ({
|
||||||
|
noteDeprecatedLegacyEnvVars: vi.fn(),
|
||||||
|
noteMacLaunchAgentOverrides: vi.fn().mockResolvedValue(undefined),
|
||||||
|
noteMacLaunchctlGatewayEnvOverrides: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-sandbox.js", () => ({
|
||||||
|
maybeRepairSandboxImages: vi.fn(async (cfg: unknown) => cfg),
|
||||||
|
noteSandboxScopeWarnings: vi.fn(),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-security.js", () => ({
|
||||||
|
noteSecurityWarnings: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-session-locks.js", () => ({
|
||||||
|
noteSessionLockHealth: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-state-integrity.js", () => ({
|
||||||
|
noteStateIntegrity: vi.fn().mockResolvedValue(undefined),
|
||||||
|
noteWorkspaceBackupTip: vi.fn(),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-ui.js", () => ({
|
||||||
|
maybeRepairUiProtocolFreshness: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("./doctor-workspace-status.js", () => ({
|
||||||
|
noteWorkspaceStatus: vi.fn(),
|
||||||
|
}));
|
||||||
|
|
||||||
describe("doctor command", () => {
|
describe("doctor command", () => {
|
||||||
it("does not add a new gateway auth token while fixing legacy issues on invalid config", async () => {
|
it("does not add a new gateway auth token while fixing legacy issues on invalid config", async () => {
|
||||||
mockDoctorConfigSnapshot({
|
mockDoctorConfigSnapshot({
|
||||||
|
|||||||
Reference in New Issue
Block a user