1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

chore: add tests for bulk scim user deletion

This commit is contained in:
Simon Hornby 2025-02-03 12:25:16 +02:00
parent 666b64e288
commit c61617415b
No known key found for this signature in database
GPG Key ID: 57BE3E58BA999B19

View File

@ -462,3 +462,32 @@ test('should return number of sessions per user', async () => {
]),
});
});
test('should only delete scim users', async () => {
userStore.insert({
email: 'boring@example.com',
});
await userStore.insert({
email: 'really-boring@example.com',
});
const scimUser = (
await db
.rawDatabase('users')
.insert({
email: 'made-by-scim@example.com',
scim_id: 'some-random-scim-id',
})
.returning('id')
)[0].id;
await app.request.delete('/api/admin/user-admin/scim-users').expect(200);
const response = await app.request.get(`/api/admin/user-admin`).expect(200);
const users = response.body.users;
expect(users.length).toBe(2);
expect(users.every((u) => u.email !== 'made-by-scim@example.com')).toBe(
true,
);
});