test: strengthen regression coverage and trim low-value checks

This commit is contained in:
Peter Steinberger
2026-03-22 07:37:17 +00:00
parent f537ea90ed
commit b4656f193a
28 changed files with 656 additions and 212 deletions

View File

@@ -48,6 +48,26 @@ describe("feishu directory (config-backed)", () => {
]);
});
it("normalizes spaced provider-prefixed peer entries", async () => {
resolveFeishuAccountMock.mockReturnValueOnce({
configured: false,
config: {
allowFrom: [" feishu:user:ou_alice "],
dms: {
" lark:dm:ou_carla ": {},
},
groups: {},
groupAllowFrom: [],
},
});
const peers = await listFeishuDirectoryPeers({ cfg });
expect(peers).toEqual([
{ kind: "user", id: "ou_alice" },
{ kind: "user", id: "ou_carla" },
]);
});
it("merges groups map + groupAllowFrom into group entries", async () => {
const groups = await listFeishuDirectoryGroups({ cfg });
expect(groups).toEqual([