Add tests

This commit is contained in:
adrinr 2023-04-14 14:50:44 +01:00
parent ce2a610c00
commit f3e6295892
2 changed files with 23 additions and 0 deletions

View File

@ -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,
})
})
})
})

View File

@ -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
}