diff options
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r-- | server/tests/api/check-params/index.ts | 1 | ||||
-rw-r--r-- | server/tests/api/check-params/videos-overviews.ts | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/server/tests/api/check-params/index.ts b/server/tests/api/check-params/index.ts index 924c0df76..ef152f55c 100644 --- a/server/tests/api/check-params/index.ts +++ b/server/tests/api/check-params/index.ts | |||
@@ -23,3 +23,4 @@ import './video-playlists' | |||
23 | import './videos' | 23 | import './videos' |
24 | import './videos-filter' | 24 | import './videos-filter' |
25 | import './videos-history' | 25 | import './videos-history' |
26 | import './videos-overviews' | ||
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 | }) | ||