惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
DataBreaches.Net
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
IT之家
IT之家
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
月光博客
月光博客
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
腾讯CDC
B
Blog RSS Feed
博客园 - Franky
爱范儿
爱范儿

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: clear setup finalize broad matchers · openclaw/open...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -239,6 +239,31 @@ function createAdvancedFinalizeArgs(params: AdvancedFinalizeArgs = {}) {

239239

};

240240

}

241241242+

function requireMockArg<T>(mock: ReturnType<typeof vi.fn>, callIndex = 0, argIndex = 0): T {

243+

const call = mock.mock.calls[callIndex];

244+

if (!call) {

245+

throw new Error(`expected mock call ${callIndex}`);

246+

}

247+

return call[argIndex] as T;

248+

}

249+250+

function expectNoteContains(

251+

prompter: ReturnType<typeof buildWizardPrompter>,

252+

expected: string,

253+

title: string,

254+

): void {

255+

const calls = vi.mocked(prompter.note).mock.calls;

256+

expect(calls.some((call) => String(call[0]).includes(expected) && call[1] === title)).toBe(true);

257+

}

258+259+

function expectNoteTitleNotCalled(

260+

prompter: ReturnType<typeof buildWizardPrompter>,

261+

title: string,

262+

): void {

263+

const calls = vi.mocked(prompter.note).mock.calls;

264+

expect(calls.every((call) => call[1] !== title)).toBe(true);

265+

}

266+242267

describe("finalizeSetupWizard", () => {

243268

beforeEach(() => {

244269

launchTuiCli.mockClear();

@@ -339,12 +364,9 @@ describe("finalizeSetupWizard", () => {

339364

}

340365

}

341366342-

expect(probeGatewayReachable).toHaveBeenCalledWith(

343-

expect.objectContaining({

344-

url: "ws://127.0.0.1:18789",

345-

password: "resolved-gateway-password", // pragma: allowlist secret

346-

}),

347-

);

367+

const probeParams = requireMockArg<{ url?: string; password?: string }>(probeGatewayReachable);

368+

expect(probeParams.url).toBe("ws://127.0.0.1:18789");

369+

expect(probeParams.password).toBe("resolved-gateway-password"); // pragma: allowlist secret

348370

expect(launchTuiCli).toHaveBeenCalledWith({

349371

local: true,

350372

deliver: false,

@@ -547,8 +569,9 @@ describe("finalizeSetupWizard", () => {

547569

}),

548570

);

549571550-

expect(prompter.note).toHaveBeenCalledWith(

551-

expect.stringContaining("selected but unavailable under the current plugin policy"),

572+

expectNoteContains(

573+

prompter,

574+

"selected but unavailable under the current plugin policy",

552575

"Web search",

553576

);

554577

expect(resolveExistingKey).not.toHaveBeenCalled();

@@ -573,8 +596,9 @@ describe("finalizeSetupWizard", () => {

573596574597

await finalizeSetupWizard(createAdvancedFinalizeArgs({ prompter }));

575598576-

expect(prompter.note).toHaveBeenCalledWith(

577-

expect.stringContaining("Web search is available via Perplexity Search (auto-detected)."),

599+

expectNoteContains(

600+

prompter,

601+

"Web search is available via Perplexity Search (auto-detected).",

578602

"Web search",

579603

);

580604

});

@@ -602,10 +626,9 @@ describe("finalizeSetupWizard", () => {

602626

}),

603627

);

604628605-

expect(prompter.note).toHaveBeenCalledWith(

606-

expect.stringContaining(

607-

"Web search is enabled, so your agent can look things up online when needed.",

608-

),

629+

expectNoteContains(

630+

prompter,

631+

"Web search is enabled, so your agent can look things up online when needed.",

609632

"Web search",

610633

);

611634

});

@@ -645,22 +668,18 @@ describe("finalizeSetupWizard", () => {

645668

runtime: createRuntime(),

646669

});

647670648-

expect(healthCommand).toHaveBeenCalledWith(

649-

expect.objectContaining({

650-

json: false,

651-

timeoutMs: 10_000,

652-

token: "session-token",

653-

config: expect.objectContaining({

654-

gateway: expect.objectContaining({

655-

auth: expect.objectContaining({

656-

mode: "token",

657-

token: "session-token",

658-

}),

659-

}),

660-

}),

661-

}),

662-

expect.any(Object),

663-

);

671+

const healthArgs = requireMockArg<{

672+

json?: boolean;

673+

timeoutMs?: number;

674+

token?: string;

675+

config?: OpenClawConfig;

676+

}>(healthCommand);

677+

expect(healthArgs.json).toBe(false);

678+

expect(healthArgs.timeoutMs).toBe(10_000);

679+

expect(healthArgs.token).toBe("session-token");

680+

expect(healthArgs.config?.gateway?.auth?.mode).toBe("token");

681+

expect(healthArgs.config?.gateway?.auth?.token).toBe("session-token");

682+

expect(requireMockArg<unknown>(healthCommand, 0, 1)).toBeTypeOf("object");

664683

});

665684666685

it("uses the resolved setup password for health checks", async () => {

@@ -703,29 +722,27 @@ describe("finalizeSetupWizard", () => {

703722

runtime: createRuntime(),

704723

});

705724706-

expect(waitForGatewayReachable).toHaveBeenCalledWith(

707-

expect.objectContaining({

708-

url: "ws://127.0.0.1:18789",

709-

token: undefined,

710-

password: "session-password",

711-

}),

712-

);

713-

expect(healthCommand).toHaveBeenCalledWith(

714-

expect.objectContaining({

715-

json: false,

716-

timeoutMs: 10_000,

717-

token: undefined,

718-

password: "session-password",

719-

config: expect.objectContaining({

720-

gateway: expect.objectContaining({

721-

auth: expect.objectContaining({

722-

mode: "password",

723-

}),

724-

}),

725-

}),

726-

}),

727-

expect.any(Object),

728-

);

725+

const waitArgs = requireMockArg<{

726+

url?: string;

727+

token?: string;

728+

password?: string;

729+

}>(waitForGatewayReachable);

730+

expect(waitArgs.url).toBe("ws://127.0.0.1:18789");

731+

expect(waitArgs.token).toBeUndefined();

732+

expect(waitArgs.password).toBe("session-password");

733+

const healthArgs = requireMockArg<{

734+

json?: boolean;

735+

timeoutMs?: number;

736+

token?: string;

737+

password?: string;

738+

config?: OpenClawConfig;

739+

}>(healthCommand);

740+

expect(healthArgs.json).toBe(false);

741+

expect(healthArgs.timeoutMs).toBe(10_000);

742+

expect(healthArgs.token).toBeUndefined();

743+

expect(healthArgs.password).toBe("session-password");

744+

expect(healthArgs.config?.gateway?.auth?.mode).toBe("password");

745+

expect(requireMockArg<unknown>(healthCommand, 0, 1)).toBeTypeOf("object");

729746

});

730747731748

it("shows actionable gateway guidance instead of a hard error in no-daemon onboarding", async () => {

@@ -765,15 +782,12 @@ describe("finalizeSetupWizard", () => {

765782

});

766783767784

expect(runtime.error).not.toHaveBeenCalledWith("health failed");

768-

expect(prompter.note).toHaveBeenCalledWith(

769-

expect.stringContaining("Setup was run without Gateway service install"),

770-

"Gateway",

771-

);

772-

expect(prompter.note).not.toHaveBeenCalledWith(expect.any(String), "Dashboard ready");

785+

expectNoteContains(prompter, "Setup was run without Gateway service install", "Gateway");

786+

expectNoteTitleNotCalled(prompter, "Dashboard ready");

773787

});

774788775789

it("does not show a Codex native search summary when web search is globally disabled", async () => {

776-

const note = vi.fn(async () => {});

790+

const note = vi.fn(async (_message: string, _title?: string) => {});

777791

const prompter = buildWizardPrompter({

778792

note,

779793

select: vi.fn(async () => "later") as never,

@@ -816,9 +830,6 @@ describe("finalizeSetupWizard", () => {

816830

runtime: createRuntime(),

817831

});

818832819-

expect(note).not.toHaveBeenCalledWith(

820-

expect.stringContaining("Codex native search:"),

821-

"Codex native search",

822-

);

833+

expect(note.mock.calls.every((call) => call[1] !== "Codex native search")).toBe(true);

823834

});

824835

});