From 76ab7c5b0510dd375641c579b3aa54bde89f6710 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 23 Apr 2026 06:13:31 +0100 Subject: [PATCH] test: align channel plugin install fixtures --- .../channel-setup/plugin-install.test.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/commands/channel-setup/plugin-install.test.ts b/src/commands/channel-setup/plugin-install.test.ts index 5f0cf9491a7..ef70f8dce58 100644 --- a/src/commands/channel-setup/plugin-install.test.ts +++ b/src/commands/channel-setup/plugin-install.test.ts @@ -125,7 +125,8 @@ const baseEntry: ChannelPluginCatalogEntry = { blurb: "Test", }, install: { - npmSpec: "@openclaw/bundled-chat", + npmSpec: "@openclaw/bundled-chat@1.2.3", + expectedIntegrity: "sha512-bundled-chat", localPath: bundledPluginRoot("bundled-chat"), }, }; @@ -138,7 +139,7 @@ function mockBundledChatSource() { { pluginId: "bundled-chat", localPath: bundledPluginRootAt("/opt/openclaw", "bundled-chat"), - npmSpec: "@openclaw/bundled-chat", + npmSpec: "@openclaw/bundled-chat@1.2.3", }, ], ]), @@ -288,7 +289,7 @@ describe("ensureChannelSetupPluginInstalled", () => { const prompter = makePrompter({ select: vi.fn(async () => "npm") as WizardPrompter["select"], }); - const cfg: OpenClawConfig = { plugins: { allow: ["other"] } }; + const cfg: OpenClawConfig = { plugins: { allow: ["bundled-chat"] } }; vi.mocked(fs.existsSync).mockReturnValue(false); installPluginFromNpmSpec.mockResolvedValue({ ok: true, @@ -308,10 +309,12 @@ describe("ensureChannelSetupPluginInstalled", () => { expect(result.cfg.plugins?.entries?.["bundled-chat"]?.enabled).toBe(true); expect(result.cfg.plugins?.allow).toContain("bundled-chat"); expect(result.cfg.plugins?.installs?.["bundled-chat"]?.source).toBe("npm"); - expect(result.cfg.plugins?.installs?.["bundled-chat"]?.spec).toBe("@openclaw/bundled-chat"); + expect(result.cfg.plugins?.installs?.["bundled-chat"]?.spec).toBe( + "@openclaw/bundled-chat@1.2.3", + ); expect(result.cfg.plugins?.installs?.["bundled-chat"]?.installPath).toBe("/tmp/bundled-chat"); expect(installPluginFromNpmSpec).toHaveBeenCalledWith( - expect.objectContaining({ spec: "@openclaw/bundled-chat" }), + expect.objectContaining({ spec: "@openclaw/bundled-chat@1.2.3" }), ); }); @@ -412,7 +415,8 @@ describe("ensureChannelSetupPluginInstalled", () => { blurb: "Test", }, install: { - npmSpec: "@vendor/bundled-chat-fork", + npmSpec: "@vendor/bundled-chat-fork@1.2.3", + expectedIntegrity: "sha512-vendor-bundled-chat-fork", }, }, prompter, @@ -425,7 +429,7 @@ describe("ensureChannelSetupPluginInstalled", () => { options: [ expect.objectContaining({ value: "npm", - label: "Download from npm (@vendor/bundled-chat-fork)", + label: "Download from npm (@vendor/bundled-chat-fork@1.2.3)", }), expect.objectContaining({ value: "skip",