From 91b6631984fa7097bd60aa013d1cf041d7b95f58 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 May 2019 15:09:38 +0200 Subject: Add pagination to account video channels endpoint --- server/tests/api/check-params/video-channels.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'server/tests/api/check-params/video-channels.ts') diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts index 65bc20613..ff04f6b03 100644 --- a/server/tests/api/check-params/video-channels.ts +++ b/server/tests/api/check-params/video-channels.ts @@ -67,8 +67,30 @@ describe('Test video channels API validator', function () { }) describe('When listing account video channels', function () { + const accountChannelPath = '/api/v1/accounts/fake/video-channels' + + it('Should fail with a bad start pagination', async function () { + await checkBadStartPagination(server.url, accountChannelPath, server.accessToken) + }) + + it('Should fail with a bad count pagination', async function () { + await checkBadCountPagination(server.url, accountChannelPath, server.accessToken) + }) + + it('Should fail with an incorrect sort', async function () { + await checkBadSortPagination(server.url, accountChannelPath, server.accessToken) + }) + it('Should fail with a unknown account', async function () { - await getAccountVideoChannelsList(server.url, 'unknown', 404) + await getAccountVideoChannelsList({ url: server.url, accountName: 'unknown', specialStatus: 404 }) + }) + + it('Should succeed with the correct parameters', async function () { + await makeGetRequest({ + url: server.url, + path: accountChannelPath, + statusCodeExpected: 200 + }) }) }) -- cgit v1.2.3