aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-19 09:44:43 +0200
committerChocobozzz <me@florianbigard.com>2021-10-20 09:25:44 +0200
commit4beda9e12adc7b1f3b178cecd6863ebf3cf431f1 (patch)
tree6244a10b286d66c6dcd7799aee630670d0493781 /server/tests/api/check-params/video-channels.ts
parent9593a78ae1368a9ad8bb11044fce6fde2892701a (diff)
downloadPeerTube-4beda9e12adc7b1f3b178cecd6863ebf3cf431f1.tar.gz
PeerTube-4beda9e12adc7b1f3b178cecd6863ebf3cf431f1.tar.zst
PeerTube-4beda9e12adc7b1f3b178cecd6863ebf3cf431f1.zip
Add ability to view my followers
Diffstat (limited to 'server/tests/api/check-params/video-channels.ts')
-rw-r--r--server/tests/api/check-params/video-channels.ts28
1 files changed, 28 insertions, 0 deletions
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index 2e63916d4..e86c315fa 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -321,6 +321,34 @@ describe('Test video channels API validator', function () {
321 }) 321 })
322 }) 322 })
323 323
324 describe('When getting channel followers', function () {
325 const path = '/api/v1/video-channels/super_channel/followers'
326
327 it('Should fail with a bad start pagination', async function () {
328 await checkBadStartPagination(server.url, path, server.accessToken)
329 })
330
331 it('Should fail with a bad count pagination', async function () {
332 await checkBadCountPagination(server.url, path, server.accessToken)
333 })
334
335 it('Should fail with an incorrect sort', async function () {
336 await checkBadSortPagination(server.url, path, server.accessToken)
337 })
338
339 it('Should fail with a unauthenticated user', async function () {
340 await makeGetRequest({ url: server.url, path, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
341 })
342
343 it('Should fail with a another user', async function () {
344 await makeGetRequest({ url: server.url, path, token: accessTokenUser, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
345 })
346
347 it('Should succeed with the correct params', async function () {
348 await makeGetRequest({ url: server.url, path, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 })
349 })
350 })
351
324 describe('When deleting a video channel', function () { 352 describe('When deleting a video channel', function () {
325 it('Should fail with a non authenticated user', async function () { 353 it('Should fail with a non authenticated user', async function () {
326 await command.delete({ token: 'coucou', channelName: 'super_channel', expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) 354 await command.delete({ token: 'coucou', channelName: 'super_channel', expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })