Add tests
This commit is contained in:
parent
ce2a610c00
commit
f3e6295892
|
@ -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,
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue