mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:50:44 +00:00
test: align channel plugin install fixtures
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user