Skip to content

Commit da8daaf

Browse files
committed
test(googlechat): align generated channel metadata and typed doctor fixtures
1 parent 26da2a5 commit da8daaf

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

‎scripts/lib/official-external-channel-catalog.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@
673673
"systemImage": "message.badge",
674674
"markdownCapable": true,
675675
"doctorCapabilities": {
676-
"dmAllowFromMode": "nestedOnly",
676+
"dmAllowFromMode": "topOnly",
677677
"groupModel": "route",
678678
"groupAllowFromFallbackToAllowFrom": false,
679679
"warnOnEmptyGroupSenderAllowlist": false

‎src/commands/doctor/shared/open-policy-allowfrom.test.ts‎

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe("doctor open-policy allowFrom repair", () => {
5858
expect(GoogleChatConfigSchema.safeParse(result.config.channels?.googlechat).success).toBe(true);
5959
});
6060

61-
it.each([
61+
it.each<{ label: string; config: GoogleChatConfig }>([
6262
{
6363
label: "root",
6464
config: { dmPolicy: "open", allowFrom: ["*"] },
@@ -83,20 +83,15 @@ describe("doctor open-policy allowFrom repair", () => {
8383
accounts: { work: { dmPolicy: "open", allowFrom: ["*"] } },
8484
},
8585
},
86-
] satisfies Array<{ label: string; config: GoogleChatConfig }>)(
87-
"preserves schema-valid googlechat $label DM access",
88-
({ config }) => {
89-
expect(GoogleChatConfigSchema.safeParse(config).success).toBe(true);
90-
91-
const result = maybeRepairOpenPolicyAllowFrom({ channels: { googlechat: config } });
92-
93-
expect(result.changes).toEqual([]);
94-
expect(result.config.channels?.googlechat).toEqual(config);
95-
expect(GoogleChatConfigSchema.safeParse(result.config.channels?.googlechat).success).toBe(
96-
true,
97-
);
98-
},
99-
);
86+
])("preserves schema-valid googlechat $label DM access", ({ config }) => {
87+
expect(GoogleChatConfigSchema.safeParse(config).success).toBe(true);
88+
89+
const result = maybeRepairOpenPolicyAllowFrom({ channels: { googlechat: config } });
90+
91+
expect(result.changes).toEqual([]);
92+
expect(result.config.channels?.googlechat).toEqual(config);
93+
expect(GoogleChatConfigSchema.safeParse(result.config.channels?.googlechat).success).toBe(true);
94+
});
10095

10196
it("repairs nested-only matrix dm allowFrom", () => {
10297
const result = maybeRepairOpenPolicyAllowFrom({

0 commit comments

Comments
 (0)