From 1b60cfb8f1fad9a4079c2d345d58298538810e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Mon, 27 Nov 2023 09:35:09 +0100 Subject: [PATCH] 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. --- packages/cli/test/integration/users.api.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/cli/test/integration/users.api.test.ts b/packages/cli/test/integration/users.api.test.ts index 53f70dca94..d2451f784c 100644 --- a/packages/cli/test/integration/users.api.test.ts +++ b/packages/cli/test/integration/users.api.test.ts @@ -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);