ci: Fix new user patching endpoint tests (no-changelog) (#7816)

user ids are uuids, and in the future we should add proper input
validation to prevent invalid user ids reaching the DB like this.
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-11-27 09:35:09 +01:00 committed by GitHub
parent 152883eed1
commit 1b60cfb8f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -499,9 +499,11 @@ describe('PATCH /users/:id/role', () => {
});
test('should receive 404 on unknown target user', async () => {
const response = await authAdminAgent.patch('/users/99999/role').send({
newRole: { scope: 'global', name: 'member' },
});
const response = await authAdminAgent
.patch('/users/c2317ff3-7a9f-4fd4-ad2b-7331f6359260/role')
.send({
newRole: { scope: 'global', name: 'member' },
});
expect(response.statusCode).toBe(404);
expect(response.body.message).toBe(NO_USER);