From bebbd5d67fbc8e422b5da447715a70033df4412d Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 02:45:32 +0100 Subject: [PATCH] test: tighten official plugin install assertions --- src/wizard/setup.official-plugins.test.ts | 92 +++++++++++++++++------ 1 file changed, 71 insertions(+), 21 deletions(-) diff --git a/src/wizard/setup.official-plugins.test.ts b/src/wizard/setup.official-plugins.test.ts index f332064cbd2..98200172a82 100644 --- a/src/wizard/setup.official-plugins.test.ts +++ b/src/wizard/setup.official-plugins.test.ts @@ -95,34 +95,84 @@ describe("setupOfficialPluginInstalls", () => { const prompter = createWizardPrompter({ multiselect: multiselect as WizardPrompter["multiselect"], }); + const runtime = createNonExitingRuntime(); await setupOfficialPluginInstalls({ config: {}, prompter, - runtime: createNonExitingRuntime(), + runtime, workspaceDir: "/tmp/workspace", }); - expect(multiselect).toHaveBeenCalledWith( - expect.objectContaining({ - message: "Install optional plugins", - }), - ); - expect(ensureOnboardingPluginInstalled).toHaveBeenCalledWith( - expect.objectContaining({ - entry: expect.objectContaining({ - pluginId: "diagnostics-otel", - trustedSourceLinkedOfficialInstall: true, - install: expect.objectContaining({ - clawhubSpec: "clawhub:@openclaw/diagnostics-otel", - npmSpec: "@openclaw/diagnostics-otel", - defaultChoice: "npm", - }), - }), - promptInstall: false, - workspaceDir: "/tmp/workspace", - }), - ); + expect(multiselect).toHaveBeenCalledExactlyOnceWith({ + message: "Install optional plugins", + options: [ + { + value: "__skip__", + label: "Skip for now", + hint: "Continue without installing optional plugins", + }, + { + value: "acpx", + label: "ACPX Runtime", + hint: "OpenClaw ACP runtime backend", + }, + { + value: "diagnostics-otel", + label: "Diagnostics OpenTelemetry", + hint: "OpenClaw diagnostics OpenTelemetry exporter", + }, + { + value: "diagnostics-prometheus", + label: "Diagnostics Prometheus", + hint: "OpenClaw diagnostics Prometheus exporter", + }, + { + value: "diffs", + label: "Diffs", + hint: "OpenClaw diff viewer plugin", + }, + { + value: "google-meet", + label: "Google Meet", + hint: "OpenClaw Google Meet participant plugin", + }, + { + value: "lobster", + label: "Lobster", + hint: "Lobster workflow tool plugin (typed pipelines + resumable approvals)", + }, + { + value: "memory-lancedb", + label: "Memory LanceDB", + hint: "OpenClaw LanceDB-backed long-term memory plugin with auto-recall/capture", + }, + { + value: "voice-call", + label: "Voice Call", + hint: "OpenClaw voice-call plugin", + }, + ], + }); + expect(ensureOnboardingPluginInstalled).toHaveBeenCalledExactlyOnceWith({ + cfg: {}, + entry: { + pluginId: "diagnostics-otel", + label: "Diagnostics OpenTelemetry", + description: "OpenClaw diagnostics OpenTelemetry exporter", + install: { + clawhubSpec: "clawhub:@openclaw/diagnostics-otel", + npmSpec: "@openclaw/diagnostics-otel", + defaultChoice: "npm", + minHostVersion: ">=2026.4.25", + }, + trustedSourceLinkedOfficialInstall: true, + }, + prompter, + runtime, + workspaceDir: "/tmp/workspace", + promptInstall: false, + }); }); it("does not install when the user skips optional plugins", async () => {