test(msteams): fix allowlist name-match expectations

This commit is contained in:
Peter Steinberger 2026-02-24 01:26:53 +00:00
parent 2e36bdda85
commit 6a7c303dcc
1 changed files with 13 additions and 1 deletions

View File

@ -184,7 +184,7 @@ describe("msteams policy", () => {
).toBe(true);
});
it("allows allowlist when sender name matches", () => {
it("blocks sender-name allowlist matches by default", () => {
expect(
isMSTeamsGroupAllowed({
groupPolicy: "allowlist",
@ -192,6 +192,18 @@ describe("msteams policy", () => {
senderId: "other",
senderName: "User",
}),
).toBe(false);
});
it("allows sender-name allowlist matches when explicitly enabled", () => {
expect(
isMSTeamsGroupAllowed({
groupPolicy: "allowlist",
allowFrom: ["user"],
senderId: "other",
senderName: "User",
allowNameMatching: true,
}),
).toBe(true);
});