Skip to content

Commit 1522f87

Browse files
committed
test(config): validate context visibility at plugin boundary
1 parent 546073c commit 1522f87

5 files changed

Lines changed: 51 additions & 73 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"core": 2359,
3-
"channel": 3674,
4-
"plugin": 4034
2+
"core": 2361,
3+
"channel": 3678,
4+
"plugin": 4028
55
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
6c2df2c784193195aea0449628b8a7f4404a95e210db6f209f11caa82ed5f63b config-baseline.json
2-
bef1a8f31a9283699635c58fc6b576e9fb79220333ea538784693b8a07379eaa config-baseline.core.json
3-
eccdecfc533f0a57b874c4d851889c41b1e7cceb5acb4f5ad6e0c5ccb2bf07e0 config-baseline.channel.json
4-
4d24c91bf670bdd4643aa368b74dd3d1332baa1cd229e0501acac7284bc2ea49 config-baseline.plugin.json
1+
432e3c16a1f06a4abf6de0b962266942001fc1072306d8673b5abce057c8f3fe config-baseline.json
2+
b0ded1a606c27b41dc14041b12ff32ebf44314032be6af31d38856bf6db10df6 config-baseline.core.json
3+
4dae169a25143f91eae0a069eb64aa848eab6b6649bcfd972c9078a1aa76bd1f config-baseline.channel.json
4+
f4bc5891610124ca99cf131c16af69b2cc38e21ac12689cc1808335c5b0d6958 config-baseline.plugin.json

‎src/config/bundled-channel-config-metadata.generated.ts‎

Lines changed: 15 additions & 15 deletions
Large diffs are not rendered by default.

‎src/config/validation.channel-metadata.test.ts‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,35 @@ describe("validateConfigObjectWithPlugins channel metadata (applyDefaults: true)
338338
}
339339
});
340340

341+
it.each([
342+
["feishu", "allowlist", "allowlist_quote"],
343+
["mattermost", "allowlist_quote", "all"],
344+
] as const)(
345+
"accepts %s contextVisibility at channel and account scope",
346+
(channelId, channelMode, accountMode) => {
347+
const result = validateConfigObjectWithPlugins({
348+
channels: {
349+
[channelId]: {
350+
contextVisibility: channelMode,
351+
accounts: { work: { contextVisibility: accountMode } },
352+
},
353+
},
354+
});
355+
356+
expect(result).toMatchObject({
357+
ok: true,
358+
config: {
359+
channels: {
360+
[channelId]: {
361+
contextVisibility: channelMode,
362+
accounts: { work: { contextVisibility: accountMode } },
363+
},
364+
},
365+
},
366+
});
367+
},
368+
);
369+
341370
it('warns on Mattermost dmPolicy="open" without wildcard allowFrom', () => {
342371
const result = validateConfigObjectWithPlugins({
343372
channels: {

‎src/plugins/contracts/channel-context-visibility.contract.test.ts‎

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)