From 764a965778ac89e027fd05dd35697c6763e0dc18 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 11 Mar 2020 14:39:28 +0100 Subject: Implement pagination for overviews endpoint --- server/tests/api/check-params/videos-overviews.ts | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 server/tests/api/check-params/videos-overviews.ts (limited to 'server/tests/api/check-params/videos-overviews.ts') 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 @@ +/* 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 ]) + }) +}) -- cgit v1.2.3