diff options
Diffstat (limited to 'server/tests/api/check-params/users.ts')
-rw-r--r-- | server/tests/api/check-params/users.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index ee591d620..a3e415b94 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts | |||
@@ -308,6 +308,26 @@ describe('Test users API validators', function () { | |||
308 | }) | 308 | }) |
309 | }) | 309 | }) |
310 | 310 | ||
311 | describe('When getting a user', function () { | ||
312 | before(async function () { | ||
313 | const res = await getUsersList(server.url, server.accessToken) | ||
314 | |||
315 | userId = res.body.data[1].id | ||
316 | }) | ||
317 | |||
318 | it('Should fail with an non authenticated user', async function () { | ||
319 | await makeGetRequest({ url: server.url, path: path + userId, token: 'super token', statusCodeExpected: 401 }) | ||
320 | }) | ||
321 | |||
322 | it('Should fail with a non admin user', async function () { | ||
323 | await makeGetRequest({ url: server.url, path, token: userAccessToken, statusCodeExpected: 403 }) | ||
324 | }) | ||
325 | |||
326 | it('Should succeed with the correct params', async function () { | ||
327 | await makeGetRequest({ url: server.url, path: path + userId, token: server.accessToken, statusCodeExpected: 200 }) | ||
328 | }) | ||
329 | }) | ||
330 | |||
311 | describe('When updating a user', function () { | 331 | describe('When updating a user', function () { |
312 | 332 | ||
313 | before(async function () { | 333 | before(async function () { |