diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-09 11:21:36 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-09 11:24:15 +0200 |
commit | 22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b (patch) | |
tree | ad8668b1480997f5e48cd5188630265aa21dfeba /server/tests/api/check-params/users.ts | |
parent | c100a6142e6571312db9f6407698a21a08b593fb (diff) | |
download | PeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.tar.gz PeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.tar.zst PeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.zip |
Add check params account ratings tests
Diffstat (limited to 'server/tests/api/check-params/users.ts')
-rw-r--r-- | server/tests/api/check-params/users.ts | 32 |
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) |