test: collapse helper plugin test suites

This commit is contained in:
Peter Steinberger
2026-03-25 04:51:51 +00:00
parent fe84148724
commit 8a463e7aa9
15 changed files with 607 additions and 623 deletions

View File

@@ -1,4 +1,5 @@
import { describe, expect, it } from "vitest";
import { resolveGoogleChatGroupRequireMention } from "./group-policy.js";
import {
isGoogleChatSpaceTarget,
isGoogleChatUserTarget,
@@ -30,3 +31,26 @@ describe("target helpers", () => {
expect(isGoogleChatUserTarget("spaces/abc")).toBe(false);
});
});
describe("googlechat group policy", () => {
it("uses generic channel group policy helpers", () => {
const cfg = {
channels: {
googlechat: {
groups: {
"spaces/AAA": {
requireMention: false,
},
"*": {
requireMention: true,
},
},
},
},
// oxlint-disable-next-line typescript/no-explicit-any
} as any;
expect(resolveGoogleChatGroupRequireMention({ cfg, groupId: "spaces/AAA" })).toBe(false);
expect(resolveGoogleChatGroupRequireMention({ cfg, groupId: "spaces/BBB" })).toBe(true);
});
});