Add ability to skip count query

This commit is contained in:
Chocobozzz
2020-01-08 14:15:16 +01:00
parent ddc07312b0
commit fe98765624
13 changed files with 55 additions and 20 deletions

View File

@@ -40,7 +40,6 @@ describe('Test videos filters', function () {
let server: ServerInfo
let userAccessToken: string
let moderatorAccessToken: string
let playlistUUID: string
// ---------------------------------------------------------------

View File

@@ -75,8 +75,12 @@ describe('Test videos API validator', function () {
await checkBadSortPagination(server.url, path)
})
it('Should fail with a bad skipVideos query', async function () {
await makeGetRequest({ url: server.url, path, statusCodeExpected: 200, query: { skipCount: 'toto' } })
})
it('Should success with the correct parameters', async function () {
await makeGetRequest({ url: server.url, path, statusCodeExpected: 200 })
await makeGetRequest({ url: server.url, path, statusCodeExpected: 200, query: { skipCount: false } })
})
})

View File

@@ -322,6 +322,15 @@ describe('Test a single server', function () {
expect(videos[0].name).to.equal(videosListBase[5].name)
})
it('Should not have the total field', async function () {
const res = await getVideosListPagination(server.url, 5, 6, 'name', true)
const videos = res.body.data
expect(res.body.total).to.not.exist
expect(videos.length).to.equal(1)
expect(videos[0].name).to.equal(videosListBase[5].name)
})
it('Should list and sort by name in descending order', async function () {
const res = await getVideosListSort(server.url, '-name')