aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/videos-overviews.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-03-11 14:39:28 +0100
committerChocobozzz <me@florianbigard.com>2020-03-11 15:02:20 +0100
commit764a965778ac89e027fd05dd35697c6763e0dc18 (patch)
treeecc18834566b940c729a57b5bf0d088e894f03d3 /server/tests/api/check-params/videos-overviews.ts
parentfab6746354f9d9cb65c35d8bd9352c4b773b4c69 (diff)
downloadPeerTube-764a965778ac89e027fd05dd35697c6763e0dc18.tar.gz
PeerTube-764a965778ac89e027fd05dd35697c6763e0dc18.tar.zst
PeerTube-764a965778ac89e027fd05dd35697c6763e0dc18.zip
Implement pagination for overviews endpoint
Diffstat (limited to 'server/tests/api/check-params/videos-overviews.ts')
-rw-r--r--server/tests/api/check-params/videos-overviews.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/server/tests/api/check-params/videos-overviews.ts b/server/tests/api/check-params/videos-overviews.ts
new file mode 100644
index 000000000..69d7fc471
--- /dev/null
+++ b/server/tests/api/check-params/videos-overviews.ts
@@ -0,0 +1,33 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2
3import 'mocha'
4import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
5import { getVideosOverview } from '@shared/extra-utils/overviews/overviews'
6
7describe('Test videos overview', function () {
8 let server: ServerInfo
9
10 // ---------------------------------------------------------------
11
12 before(async function () {
13 this.timeout(30000)
14
15 server = await flushAndRunServer(1)
16 })
17
18 describe('When getting videos overview', function () {
19
20 it('Should fail with a bad pagination', async function () {
21 await getVideosOverview(server.url, 0, 400)
22 await getVideosOverview(server.url, 100, 400)
23 })
24
25 it('Should succeed with a good pagination', async function () {
26 await getVideosOverview(server.url, 1)
27 })
28 })
29
30 after(async function () {
31 await cleanupTests([ server ])
32 })
33})