2020-03-11 09:39:28 -04:00
|
|
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
|
|
|
|
|
|
|
import 'mocha'
|
2021-12-17 03:29:23 -05:00
|
|
|
import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/server-commands'
|
2020-03-11 09:39:28 -04:00
|
|
|
|
|
|
|
describe('Test videos overview', function () {
|
2021-07-16 03:47:51 -04:00
|
|
|
let server: PeerTubeServer
|
2020-03-11 09:39:28 -04:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
|
|
|
|
|
|
before(async function () {
|
|
|
|
this.timeout(30000)
|
|
|
|
|
2021-07-16 03:47:51 -04:00
|
|
|
server = await createSingleServer(1)
|
2020-03-11 09:39:28 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
describe('When getting videos overview', function () {
|
|
|
|
|
|
|
|
it('Should fail with a bad pagination', async function () {
|
2021-07-16 03:04:35 -04:00
|
|
|
await server.overviews.getVideos({ page: 0, expectedStatus: 400 })
|
|
|
|
await server.overviews.getVideos({ page: 100, expectedStatus: 400 })
|
2020-03-11 09:39:28 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Should succeed with a good pagination', async function () {
|
2021-07-16 03:04:35 -04:00
|
|
|
await server.overviews.getVideos({ page: 1 })
|
2020-03-11 09:39:28 -04:00
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
after(async function () {
|
|
|
|
await cleanupTests([ server ])
|
|
|
|
})
|
|
|
|
})
|