X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fvideo-abuses.ts;h=e643cb95e529acf6f25cb5d47ef728dd40ae94c3;hb=3b0bd70aa05ab82fa30fe67ed4899d44652c703a;hp=e2813d470cf5c8ef6b0a48e55b3e9d224331de62;hpb=210feb6cc484a6c5c63c98f770de34e223f944cb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/video-abuses.ts b/server/tests/api/check-params/video-abuses.ts index e2813d470..e643cb95e 100644 --- a/server/tests/api/check-params/video-abuses.ts +++ b/server/tests/api/check-params/video-abuses.ts @@ -1,15 +1,14 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' import { + cleanupTests, createUser, deleteVideoAbuse, - flushTests, - killallServers, + flushAndRunServer, makeGetRequest, makePostBodyRequest, - flushAndRunServer, ServerInfo, setAccessTokensToServers, updateVideoAbuse, @@ -77,6 +76,22 @@ describe('Test video abuses API validators', function () { statusCodeExpected: 403 }) }) + + it('Should fail with a bad id filter', async function () { + await makeGetRequest({ url: server.url, path, token: server.accessToken, query: { id: 'toto' } }) + }) + + it('Should fail with a bad state filter', async function () { + await makeGetRequest({ url: server.url, path, token: server.accessToken, query: { state: 'toto' } }) + }) + + it('Should fail with a bad videoIs filter', async function () { + await makeGetRequest({ url: server.url, path, token: server.accessToken, query: { videoIs: 'toto' } }) + }) + + it('Should succeed with the correct params', async function () { + await makeGetRequest({ url: server.url, path, token: server.accessToken, query: { id: 13 }, statusCodeExpected: 200 }) + }) }) describe('When reporting a video abuse', function () { @@ -127,6 +142,7 @@ describe('Test video abuses API validators', function () { describe('When updating a video abuse', function () { const basePath = '/api/v1/videos/' + // eslint-disable-next-line @typescript-eslint/no-unused-vars let path: string before(() => { @@ -164,6 +180,7 @@ describe('Test video abuses API validators', function () { describe('When deleting a video abuse', function () { const basePath = '/api/v1/videos/' + // eslint-disable-next-line @typescript-eslint/no-unused-vars let path: string before(() => { @@ -188,7 +205,7 @@ describe('Test video abuses API validators', function () { }) }) - after(function () { - killallServers([ server ]) + after(async function () { + await cleanupTests([ server ]) }) })