2020-03-11 08:39:28 -05:00
|
|
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
|
|
|
|
|
|
|
import 'mocha'
|
2021-07-06 07:30:20 -05:00
|
|
|
import { cleanupTests, flushAndRunServer, ServerInfo } from '@shared/extra-utils'
|
2020-03-11 08:39:28 -05:00
|
|
|
|
|
|
|
describe('Test videos overview', function () {
|
|
|
|
let server: ServerInfo
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
|
|
|
|
|
|
before(async function () {
|
|
|
|
this.timeout(30000)
|
|
|
|
|
|
|
|
server = await flushAndRunServer(1)
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('When getting videos overview', function () {
|
|
|
|
|
|
|
|
it('Should fail with a bad pagination', async function () {
|
2021-07-06 07:30:20 -05:00
|
|
|
await server.overviewsCommand.getVideos({ page: 0, expectedStatus: 400 })
|
|
|
|
await server.overviewsCommand.getVideos({ page: 100, expectedStatus: 400 })
|
2020-03-11 08:39:28 -05:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Should succeed with a good pagination', async function () {
|
2021-07-06 07:30:20 -05:00
|
|
|
await server.overviewsCommand.getVideos({ page: 1 })
|
2020-03-11 08:39:28 -05:00
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
after(async function () {
|
|
|
|
await cleanupTests([ server ])
|
|
|
|
})
|
|
|
|
})
|