From ce2a610c00b112886a45e412e6850f21b7ee14d5 Mon Sep 17 00:00:00 2001 From: adrinr Date: Fri, 14 Apr 2023 14:48:48 +0100 Subject: [PATCH] Test exclude members --- .../src/api/routes/global/tests/scim.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/worker/src/api/routes/global/tests/scim.spec.ts b/packages/worker/src/api/routes/global/tests/scim.spec.ts index 77e9cbea26..91675a12b8 100644 --- a/packages/worker/src/api/routes/global/tests/scim.spec.ts +++ b/packages/worker/src/api/routes/global/tests/scim.spec.ts @@ -600,6 +600,25 @@ describe("scim", () => { totalResults: 1, }) }) + + it("can fetch groups excluding members", async () => { + const response = await getScimGroups({ + params: { excludedAttributes: "members" }, + }) + + expect(response).toEqual({ + Resources: expect.arrayContaining( + groups.map(g => { + const { members, ...groupData } = g + return groupData + }) + ), + itemsPerPage: 25, + schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"], + startIndex: 1, + totalResults: groupCount, + }) + }) }) })