From c83cf33707f9df318c6def4c7dc73f4b3c76a73a Mon Sep 17 00:00:00 2001 From: adrinr Date: Fri, 14 Apr 2023 15:14:41 +0100 Subject: [PATCH] Test get group without members --- .../worker/src/api/routes/global/tests/scim.spec.ts | 10 ++++++++++ packages/worker/src/tests/api/scim/groups.ts | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) 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 4381d86c7f..db47493685 100644 --- a/packages/worker/src/api/routes/global/tests/scim.spec.ts +++ b/packages/worker/src/api/routes/global/tests/scim.spec.ts @@ -715,6 +715,16 @@ describe("scim", () => { status: 404, }) }) + + it("should allow excluding members", async () => { + const response = await findScimGroup(group.id, { + qs: "excludedAttributes=members", + }) + + const { members, ...expectedResponse } = group + + expect(response).toEqual(expectedResponse) + }) }) describe("DELETE /api/global/scim/v2/groups/:id", () => { diff --git a/packages/worker/src/tests/api/scim/groups.ts b/packages/worker/src/tests/api/scim/groups.ts index c494036530..d2df007614 100644 --- a/packages/worker/src/tests/api/scim/groups.ts +++ b/packages/worker/src/tests/api/scim/groups.ts @@ -58,9 +58,12 @@ export class ScimGroupsAPI extends ScimTestAPI { return res.body as ScimGroupResponse } - find = async (id: string, requestSettings?: Partial) => { + find = async ( + id: string, + requestSettings?: Partial & { qs?: string } + ) => { const res = await this.call( - `/api/global/scim/v2/groups/${id}`, + `/api/global/scim/v2/groups/${id}?${requestSettings?.qs}`, "get", requestSettings )