aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/users.ts32
1 files changed, 32 insertions, 0 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index 13be8b460..f3ee99e85 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -538,6 +538,38 @@ describe('Test users API validators', function () {
538 }) 538 })
539 }) 539 })
540 540
541 describe('When retrieving my global ratings', function () {
542 const path = '/api/v1/accounts/user1/ratings'
543
544 it('Should fail with a bad start pagination', async function () {
545 await checkBadStartPagination(server.url, path, userAccessToken)
546 })
547
548 it('Should fail with a bad count pagination', async function () {
549 await checkBadCountPagination(server.url, path, userAccessToken)
550 })
551
552 it('Should fail with an incorrect sort', async function () {
553 await checkBadSortPagination(server.url, path, userAccessToken)
554 })
555
556 it('Should fail with a unauthenticated user', async function () {
557 await makeGetRequest({ url: server.url, path, statusCodeExpected: 401 })
558 })
559
560 it('Should fail with a another user', async function () {
561 await makeGetRequest({ url: server.url, path, token: server.accessToken, statusCodeExpected: 403 })
562 })
563
564 it('Should fail with a bad type', async function () {
565 await makeGetRequest({ url: server.url, path, token: userAccessToken, query: { rating: 'toto ' }, statusCodeExpected: 400 })
566 })
567
568 it('Should succeed with the correct params', async function () {
569 await makeGetRequest({ url: server.url, path, token: userAccessToken, statusCodeExpected: 200 })
570 })
571 })
572
541 describe('When blocking/unblocking/removing user', function () { 573 describe('When blocking/unblocking/removing user', function () {
542 it('Should fail with an incorrect id', async function () { 574 it('Should fail with an incorrect id', async function () {
543 await removeUser(server.url, 'blabla', server.accessToken, 400) 575 await removeUser(server.url, 'blabla', server.accessToken, 400)