X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fvideo-imports.ts;h=f954ba0898095ca33a3657df127f1c219a7cbe9e;hb=b488ba1e26b803ac6c637e8b11bdd444ca4c803f;hp=dbea39c48cb3340142e061b2e9ccf7c1e66dc073;hpb=4c1def5fd8e9f483238eb38e221f555e2e6bbf07;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 dbea39c48..f954ba089 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts @@ -1,9 +1,8 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import { omit } from 'lodash' import 'mocha' +import { omit } from 'lodash' import { join } from 'path' -import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' import { cleanupTests, createUser, @@ -23,14 +22,13 @@ import { checkBadSortPagination, checkBadStartPagination } from '../../../../shared/extra-utils/requests/check-api-params' -import { getMagnetURI, getYoutubeVideoUrl } from '../../../../shared/extra-utils/videos/video-imports' +import { getMagnetURI, getGoodVideoUrl } from '../../../../shared/extra-utils/videos/video-imports' +import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' describe('Test video imports API validator', function () { const path = '/api/v1/videos/imports' let server: ServerInfo let userAccessToken = '' - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let accountName: string let channelId: number // --------------------------------------------------------------- @@ -50,7 +48,6 @@ describe('Test video imports API validator', function () { { const res = await getMyUserInformation(server.url, server.accessToken) channelId = res.body.videoChannels[0].id - accountName = res.body.account.name + '@' + res.body.account.host } }) @@ -79,7 +76,7 @@ describe('Test video imports API validator', function () { before(function () { baseCorrectParams = { - targetUrl: getYoutubeVideoUrl(), + targetUrl: getGoodVideoUrl(), name: 'my super name', category: 5, licence: 1, @@ -249,15 +246,13 @@ describe('Test video imports API validator', function () { it('Should succeed with the correct parameters', async function () { this.timeout(30000) - { - await makePostBodyRequest({ - url: server.url, - path, - token: server.accessToken, - fields: baseCorrectParams, - statusCodeExpected: 200 - }) - } + await makePostBodyRequest({ + url: server.url, + path, + token: server.accessToken, + fields: baseCorrectParams, + statusCodeExpected: 200 + }) }) it('Should forbid to import http videos', async function () {