aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/videos-filter.ts1
-rw-r--r--server/tests/api/check-params/videos.ts6
-rw-r--r--server/tests/api/videos/single-server.ts9
3 files changed, 14 insertions, 2 deletions
diff --git a/server/tests/api/check-params/videos-filter.ts b/server/tests/api/check-params/videos-filter.ts
index 5a5668665..811756745 100644
--- a/server/tests/api/check-params/videos-filter.ts
+++ b/server/tests/api/check-params/videos-filter.ts
@@ -40,7 +40,6 @@ describe('Test videos filters', function () {
40 let server: ServerInfo 40 let server: ServerInfo
41 let userAccessToken: string 41 let userAccessToken: string
42 let moderatorAccessToken: string 42 let moderatorAccessToken: string
43 let playlistUUID: string
44 43
45 // --------------------------------------------------------------- 44 // ---------------------------------------------------------------
46 45
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index fa6d6f622..16ef1c505 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -75,8 +75,12 @@ describe('Test videos API validator', function () {
75 await checkBadSortPagination(server.url, path) 75 await checkBadSortPagination(server.url, path)
76 }) 76 })
77 77
78 it('Should fail with a bad skipVideos query', async function () {
79 await makeGetRequest({ url: server.url, path, statusCodeExpected: 200, query: { skipCount: 'toto' } })
80 })
81
78 it('Should success with the correct parameters', async function () { 82 it('Should success with the correct parameters', async function () {
79 await makeGetRequest({ url: server.url, path, statusCodeExpected: 200 }) 83 await makeGetRequest({ url: server.url, path, statusCodeExpected: 200, query: { skipCount: false } })
80 }) 84 })
81 }) 85 })
82 86
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts
index d8f394ac7..362d6b78f 100644
--- a/server/tests/api/videos/single-server.ts
+++ b/server/tests/api/videos/single-server.ts
@@ -322,6 +322,15 @@ describe('Test a single server', function () {
322 expect(videos[0].name).to.equal(videosListBase[5].name) 322 expect(videos[0].name).to.equal(videosListBase[5].name)
323 }) 323 })
324 324
325 it('Should not have the total field', async function () {
326 const res = await getVideosListPagination(server.url, 5, 6, 'name', true)
327
328 const videos = res.body.data
329 expect(res.body.total).to.not.exist
330 expect(videos.length).to.equal(1)
331 expect(videos[0].name).to.equal(videosListBase[5].name)
332 })
333
325 it('Should list and sort by name in descending order', async function () { 334 it('Should list and sort by name in descending order', async function () {
326 const res = await getVideosListSort(server.url, '-name') 335 const res = await getVideosListSort(server.url, '-name')
327 336