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 91675a12b8..4381d86c7f 100644 --- a/packages/worker/src/api/routes/global/tests/scim.spec.ts +++ b/packages/worker/src/api/routes/global/tests/scim.spec.ts @@ -619,6 +619,25 @@ describe("scim", () => { totalResults: groupCount, }) }) + + it("can fetch groups excluding multiple fields", async () => { + const response = await getScimGroups({ + params: { excludedAttributes: "members,displayName" }, + }) + + expect(response).toEqual({ + Resources: expect.arrayContaining( + groups.map(g => { + const { members, displayName, ...groupData } = g + return groupData + }) + ), + itemsPerPage: 25, + schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"], + startIndex: 1, + totalResults: groupCount, + }) + }) }) }) diff --git a/packages/worker/src/tests/api/scim/groups.ts b/packages/worker/src/tests/api/scim/groups.ts index 96ff9aeb67..c494036530 100644 --- a/packages/worker/src/tests/api/scim/groups.ts +++ b/packages/worker/src/tests/api/scim/groups.ts @@ -18,6 +18,7 @@ export class ScimGroupsAPI extends ScimTestAPI { startIndex?: number pageSize?: number filter?: string + excludedAttributes?: string } } ) => { @@ -32,6 +33,9 @@ export class ScimGroupsAPI extends ScimTestAPI { if (params?.filter) { url += `filter=${params.filter}&` } + if (params?.excludedAttributes) { + url += `excludedAttributes=${params.excludedAttributes}&` + } const res = await this.call(url, "get", requestSettings) return res.body as ScimGroupListResponse }