Add extra tests

This commit is contained in:
adrinr 2023-03-16 15:07:03 +01:00
parent d452f5cf0d
commit de716ba869
1 changed files with 28 additions and 0 deletions

View File

@ -413,6 +413,34 @@ describe("/api/global/scim/v2/users", () => {
const persistedUser = await config.api.scimUsersAPI.find(user.id)
expect(persistedUser).toEqual(expectedScimUser)
})
it("supports updating unmapped fields", async () => {
const body: ScimUpdateRequest = {
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
Operations: [
{
op: "Add",
path: "displayName",
value: structures.generator.name(),
},
{
op: "Add",
path: "preferredLanguage",
value: structures.generator.letter(),
},
],
}
const response = await patchScimUser({ id: user.id, body })
const expectedScimUser: ScimUserResponse = {
...user,
}
expect(response).toEqual(expectedScimUser)
const persistedUser = await config.api.scimUsersAPI.find(user.id)
expect(persistedUser).toEqual(expectedScimUser)
})
})
describe("DELETE /api/global/scim/v2/users/:id", () => {