mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 05:37:27 +00:00
test: trim duplicate program smoke onboarding coverage
This commit is contained in:
@@ -67,47 +67,10 @@ describe("cli program (smoke)", () => {
|
|||||||
expect(runTui).toHaveBeenCalledWith(expect.objectContaining({ timeoutMs: undefined }));
|
expect(runTui).toHaveBeenCalledWith(expect.objectContaining({ timeoutMs: undefined }));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("runs config alias as configure", async () => {
|
it("runs setup wizard when wizard flags are present", async () => {
|
||||||
await runProgram(["config"]);
|
await runProgram(["setup", "--remote-url", "ws://example"]);
|
||||||
expect(configureCommand).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
expect(setupCommand).not.toHaveBeenCalled();
|
||||||
{
|
expect(onboardCommand).toHaveBeenCalledTimes(1);
|
||||||
label: "runs setup without wizard flags",
|
|
||||||
argv: ["setup"],
|
|
||||||
expectSetupCalled: true,
|
|
||||||
expectOnboardCalled: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "runs setup wizard when wizard flags are present",
|
|
||||||
argv: ["setup", "--remote-url", "ws://example"],
|
|
||||||
expectSetupCalled: false,
|
|
||||||
expectOnboardCalled: true,
|
|
||||||
},
|
|
||||||
])("setup command: $label", async ({ argv, expectSetupCalled, expectOnboardCalled }) => {
|
|
||||||
await runProgram(argv);
|
|
||||||
expect(setupCommand).toHaveBeenCalledTimes(expectSetupCalled ? 1 : 0);
|
|
||||||
expect(onboardCommand).toHaveBeenCalledTimes(expectOnboardCalled ? 1 : 0);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("passes representative auth flags to onboard", async () => {
|
|
||||||
await runProgram([
|
|
||||||
"onboard",
|
|
||||||
"--non-interactive",
|
|
||||||
"--auth-choice",
|
|
||||||
"openrouter-api-key",
|
|
||||||
"--openrouter-api-key",
|
|
||||||
"sk-openrouter-test",
|
|
||||||
]);
|
|
||||||
|
|
||||||
expect(onboardCommand).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
nonInteractive: true,
|
|
||||||
authChoice: "openrouter-api-key",
|
|
||||||
openrouterApiKey: "sk-openrouter-test",
|
|
||||||
}),
|
|
||||||
runtime,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user