aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/videos-overviews.ts
blob: 69d7fc4713007950395880afe5ec8c1718716d27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */

import 'mocha'
import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
import { getVideosOverview } from '@shared/extra-utils/overviews/overviews'

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 () {
      await getVideosOverview(server.url, 0, 400)
      await getVideosOverview(server.url, 100, 400)
    })

    it('Should succeed with a good pagination', async function () {
      await getVideosOverview(server.url, 1)
    })
  })

  after(async function () {
    await cleanupTests([ server ])
  })
})