1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

Test activations

This commit is contained in:
adrinr 2023-03-16 15:19:16 +01:00
parent e222381a6c
commit 51ebad2b14

View file

@ -417,6 +417,36 @@ describe("/api/global/scim/v2/users", () => {
}
)
it.each([true, "true", "True"])(
"can activate an inactive user (sending %s)",
async activeValue => {
// Deactivate user
await patchScimUser({
id: user.id,
body: {
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
Operations: [{ op: "Replace", path: "active", value: true }],
},
})
const body: ScimUpdateRequest = {
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
Operations: [{ op: "Replace", path: "active", value: activeValue }],
}
const response = await patchScimUser({ id: user.id, body })
const expectedScimUser: ScimUserResponse = {
...user,
active: true,
}
expect(response).toEqual(expectedScimUser)
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"],