From 59f75e793ca24fd41125e51f17f672d91e4e613a Mon Sep 17 00:00:00 2001 From: Shakker Date: Sat, 9 May 2026 02:47:37 +0100 Subject: [PATCH] test: update cli guidance assertions --- src/cli/acp-cli.option-collisions.test.ts | 4 ++-- src/cli/daemon-cli/status.test.ts | 4 +++- src/cli/devices-cli.test.ts | 4 +++- src/commands/auth-choice.test.ts | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cli/acp-cli.option-collisions.test.ts b/src/cli/acp-cli.option-collisions.test.ts index 7bef752f1e5..2266f23ac3f 100644 --- a/src/cli/acp-cli.option-collisions.test.ts +++ b/src/cli/acp-cli.option-collisions.test.ts @@ -101,7 +101,7 @@ describe("acp cli option collisions", () => { name: "rejects mixed secret flags and file flags", files: { token: "tok_file\n" }, args: (tokenFile: string) => ["--token", "tok_inline", "--token-file", tokenFile], - expected: /Use either --token or --token-file/, + expected: /Use either --token .*--token-file for Gateway token\./, }, { name: "rejects mixed password flags and file flags", @@ -112,7 +112,7 @@ describe("acp cli option collisions", () => { "--password-file", passwordFile, ], - expected: /Use either --password or --password-file/, + expected: /Use either --passw.*d .*--password-file for Gateway password\./, }, ])("$name", async ({ files, args, expected }) => { await withTempSecretFiles("openclaw-acp-cli-", files, async ({ tokenFile, passwordFile }) => { diff --git a/src/cli/daemon-cli/status.test.ts b/src/cli/daemon-cli/status.test.ts index 98f3b8c6c88..abab4096431 100644 --- a/src/cli/daemon-cli/status.test.ts +++ b/src/cli/daemon-cli/status.test.ts @@ -103,6 +103,8 @@ describe("runDaemonStatus", () => { ).rejects.toThrow("__exit__:1"); expect(gatherDaemonStatus).not.toHaveBeenCalled(); - expect(runtimeErrors.join("\n")).toContain("--require-rpc cannot be used with --no-probe"); + expect(runtimeErrors[0]).toBe( + "Gateway status failed: --require-rpc needs probing enabled. Remove --no-probe or drop --require-rpc.", + ); }); }); diff --git a/src/cli/devices-cli.test.ts b/src/cli/devices-cli.test.ts index e68077097b5..4ec0d22a1f4 100644 --- a/src/cli/devices-cli.test.ts +++ b/src/cli/devices-cli.test.ts @@ -538,7 +538,9 @@ describe("devices cli tokens", () => { await runDevicesCommand(["rotate", "--device", " ", "--role", "main"]); expect(callGateway).not.toHaveBeenCalled(); - expect(runtime.error).toHaveBeenCalledWith("--device and --role required"); + expect(runtime.error).toHaveBeenCalledWith( + "--device and --role are required. Run openclaw devices list to choose a paired device.", + ); expect(runtime.exit).toHaveBeenCalledWith(1); }); }); diff --git a/src/commands/auth-choice.test.ts b/src/commands/auth-choice.test.ts index a5ce3135d08..d18caca3c4c 100644 --- a/src/commands/auth-choice.test.ts +++ b/src/commands/auth-choice.test.ts @@ -716,7 +716,7 @@ describe("applyAuthChoice", () => { setDefaultModel: true, }), ).rejects.toThrow( - 'Auth choice "openai-codex-import" is no longer supported. Use "openai-codex" instead.', + 'Auth choice "openai-codex-import" is no longer supported. Use "openai-codex" instead, or run openclaw onboard to choose interactively.', ); } finally { spy.mockRestore(); @@ -739,7 +739,7 @@ describe("applyAuthChoice", () => { setDefaultModel: true, }), ).rejects.toThrow( - 'Auth choice "legacy\\u001b[31mchoice" is no longer supported. Use "modern\\nchoice" instead.', + 'Auth choice "legacy\\u001b[31mchoice" is no longer supported. Use "modern\\nchoice" instead, or run openclaw onboard to choose interactively.', ); } finally { spy.mockRestore();