X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fvideo-imports.ts;h=7f19b9ee9b1f84ae0d6e3c76298ba78d719150e1;hb=8d1f78044ca6eb9995001d3ab83be62460e043a6;hp=85382b261e5a04061936e65435a05b0d15cc46da;hpb=a3b472a12ec6e57dbe2f650419f8064864686eab;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index 85382b261..7f19b9ee9 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts @@ -1,9 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' -import { omit } from 'lodash' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, FIXTURE_URLS } from '@server/tests/shared' -import { buildAbsoluteFixturePath } from '@shared/core-utils' +import { buildAbsoluteFixturePath, omit } from '@shared/core-utils' import { HttpStatusCode, VideoPrivacy } from '@shared/models' import { cleanupTests, @@ -107,7 +105,7 @@ describe('Test video imports API validator', function () { }) it('Should fail without a target url', async function () { - const fields = omit(baseCorrectParams, 'targetUrl') + const fields = omit(baseCorrectParams, [ 'targetUrl' ]) await makePostBodyRequest({ url: server.url, path, @@ -189,7 +187,7 @@ describe('Test video imports API validator', function () { }) it('Should fail without a channel', async function () { - const fields = omit(baseCorrectParams, 'channelId') + const fields = omit(baseCorrectParams, [ 'channelId' ]) await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) }) @@ -271,7 +269,7 @@ describe('Test video imports API validator', function () { }) it('Should fail with an invalid torrent file', async function () { - const fields = omit(baseCorrectParams, 'targetUrl') + const fields = omit(baseCorrectParams, [ 'targetUrl' ]) const attaches = { torrentfile: buildAbsoluteFixturePath('avatar-big.png') } @@ -280,7 +278,7 @@ describe('Test video imports API validator', function () { }) it('Should fail with an invalid magnet URI', async function () { - let fields = omit(baseCorrectParams, 'targetUrl') + let fields = omit(baseCorrectParams, [ 'targetUrl' ]) fields = { ...fields, magnetUri: 'blabla' } await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) @@ -339,7 +337,7 @@ describe('Test video imports API validator', function () { } }) - let fields = omit(baseCorrectParams, 'targetUrl') + let fields = omit(baseCorrectParams, [ 'targetUrl' ]) fields = { ...fields, magnetUri: FIXTURE_URLS.magnet } await makePostBodyRequest({ @@ -350,7 +348,7 @@ describe('Test video imports API validator', function () { expectedStatus: HttpStatusCode.CONFLICT_409 }) - fields = omit(fields, 'magnetUri') + fields = omit(fields, [ 'magnetUri' ]) const attaches = { torrentfile: buildAbsoluteFixturePath('video-720p.torrent') }