diff options
Diffstat (limited to 'server/tests/api/check-params/video-channels.ts')
-rw-r--r-- | server/tests/api/check-params/video-channels.ts | 28 |
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 }) |