X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fjobs.ts;h=8f4af8d162a32fb13023268221fbe9800cff59b8;hb=77e9f859c6ad75ba179dec74e5410cc651eaa49b;hp=682406e87282a98d55043866931b436b084019e0;hpb=94565d52bb2883e09f16d1363170ac9c0dccb7a1;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/jobs.ts b/server/tests/api/check-params/jobs.ts index 682406e87..8f4af8d16 100644 --- a/server/tests/api/check-params/jobs.ts +++ b/server/tests/api/check-params/jobs.ts @@ -1,12 +1,11 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' import { + cleanupTests, createUser, - flushTests, - killallServers, - runServer, + flushAndRunServer, ServerInfo, setAccessTokensToServers, userLogin @@ -28,9 +27,7 @@ describe('Test jobs API validators', function () { before(async function () { this.timeout(120000) - await flushTests() - - server = await runServer(1) + server = await flushAndRunServer(1) await setAccessTokensToServers([ server ]) @@ -52,6 +49,17 @@ describe('Test jobs API validators', function () { }) }) + it('Should fail with an incorrect job type', async function () { + await makeGetRequest({ + url: server.url, + token: server.accessToken, + path, + query: { + jobType: 'toto' + } + }) + }) + it('Should fail with a bad start pagination', async function () { await checkBadStartPagination(server.url, path, server.accessToken) }) @@ -80,14 +88,10 @@ describe('Test jobs API validators', function () { statusCodeExpected: 403 }) }) + }) after(async function () { - killallServers([ server ]) - - // Keep the logs if the test failed - if (this['ok']) { - await flushTests() - } + await cleanupTests([ server ]) }) })