test: tighten official plugin install assertions

This commit is contained in:
Shakker
2026-05-11 02:45:32 +01:00
parent ccbf3132de
commit bebbd5d67f

View File

@@ -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 () => {