PeerTube/server/tests/api/check-params/videos-overviews.ts

33 lines
929 B
TypeScript
Raw Normal View History

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