diff options
Diffstat (limited to 'server/tests/api/check-params/videos-overviews.ts')
-rw-r--r-- | server/tests/api/check-params/videos-overviews.ts | 33 |
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 | |||
3 | import 'mocha' | ||
4 | import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils' | ||
5 | import { getVideosOverview } from '@shared/extra-utils/overviews/overviews' | ||
6 | |||
7 | describe('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 | }) | ||