Skip to content

Commit b81c2eb

Browse files
committed
test: cover repaired channel plugin allowlist
1 parent 50fcbca commit b81c2eb

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

src/config/plugin-auto-enable.channels.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,42 @@ describe("applyPluginAutoEnable channels", () => {
237237
);
238238
});
239239

240+
it("allowlists repaired external channel plugins under restrictive plugin policy", () => {
241+
const result = materializePluginAutoEnableCandidates({
242+
config: {
243+
channels: {
244+
mattermost: {
245+
baseUrl: "http://mattermost:8065",
246+
},
247+
},
248+
plugins: {
249+
allow: ["telegram"],
250+
},
251+
},
252+
candidates: [
253+
{
254+
pluginId: "mattermost",
255+
kind: "configured-plugin-repaired",
256+
},
257+
],
258+
env: makeIsolatedEnv(),
259+
manifestRegistry: makeRegistry([
260+
{
261+
id: "mattermost",
262+
channels: ["mattermost"],
263+
origin: "global",
264+
},
265+
]),
266+
});
267+
268+
expect(result.config.plugins?.entries?.mattermost?.enabled).toBe(true);
269+
expect(result.config.plugins?.allow).toEqual(["telegram", "mattermost"]);
270+
expect(result.config.channels?.mattermost?.enabled).toBeUndefined();
271+
expect(result.changes).toContain(
272+
"mattermost installed for existing configuration, enabled automatically.",
273+
);
274+
});
275+
240276
it("uses the plugin manifest id, not the channel id, for plugins.entries", () => {
241277
const result = applyWithApnChannelConfig();
242278

0 commit comments

Comments
 (0)