Test activations
This commit is contained in:
parent
e222381a6c
commit
51ebad2b14
|
@ -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"],
|
||||
|
|
Loading…
Reference in New Issue