+
+ it('Should fail with an invalid channel', async function () {
+ await makeGetRequest({ url: server.url, token: server.accessToken, path, query: { channelId: 'toto' } })
+ })
+
+ it('Should fail with an unknown channel', async function () {
+ await makeGetRequest({
+ url: server.url,
+ token: server.accessToken,
+ path,
+ query: { channelId: 89898 },
+ expectedStatus: HttpStatusCode.NOT_FOUND_404
+ })
+ })
+
+ it('Should success with the correct parameters', async function () {
+ await makeGetRequest({ url: server.url, token: server.accessToken, path, expectedStatus: HttpStatusCode.OK_200 })
+ })
+ })
+
+ describe('When listing account videos', function () {
+ let path: string
+
+ before(async function () {
+ path = '/api/v1/accounts/' + accountName + '/videos'
+ })
+
+ it('Should fail with a bad start pagination', async function () {
+ await checkBadStartPagination(server.url, path, server.accessToken)
+ })
+
+ it('Should fail with a bad count pagination', async function () {
+ await checkBadCountPagination(server.url, path, server.accessToken)
+ })
+
+ it('Should fail with an incorrect sort', async function () {
+ await checkBadSortPagination(server.url, path, server.accessToken)
+ })
+
+ it('Should success with the correct parameters', async function () {
+ await makeGetRequest({ url: server.url, path, expectedStatus: HttpStatusCode.OK_200 })
+ })
+ })
+
+ describe('When listing video channel videos', function () {
+ let path: string
+
+ before(async function () {
+ path = '/api/v1/video-channels/' + channelName + '/videos'
+ })
+
+ it('Should fail with a bad start pagination', async function () {
+ await checkBadStartPagination(server.url, path, server.accessToken)
+ })
+
+ it('Should fail with a bad count pagination', async function () {
+ await checkBadCountPagination(server.url, path, server.accessToken)
+ })
+
+ it('Should fail with an incorrect sort', async function () {
+ await checkBadSortPagination(server.url, path, server.accessToken)
+ })
+
+ it('Should success with the correct parameters', async function () {
+ await makeGetRequest({ url: server.url, path, expectedStatus: HttpStatusCode.OK_200 })
+ })