diff options
Diffstat (limited to 'server/tests/api/check-params/video-imports.ts')
-rw-r--r-- | server/tests/api/check-params/video-imports.ts | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index a27b624d0..dae3860ef 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts | |||
@@ -2,9 +2,12 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 5 | import { HttpStatusCode } from '@shared/core-utils' |
6 | import { | 6 | import { |
7 | buildAbsoluteFixturePath, | 7 | buildAbsoluteFixturePath, |
8 | checkBadCountPagination, | ||
9 | checkBadSortPagination, | ||
10 | checkBadStartPagination, | ||
8 | cleanupTests, | 11 | cleanupTests, |
9 | createUser, | 12 | createUser, |
10 | flushAndRunServer, | 13 | flushAndRunServer, |
@@ -15,16 +18,10 @@ import { | |||
15 | makeUploadRequest, | 18 | makeUploadRequest, |
16 | ServerInfo, | 19 | ServerInfo, |
17 | setAccessTokensToServers, | 20 | setAccessTokensToServers, |
18 | updateCustomSubConfig, | ||
19 | userLogin | 21 | userLogin |
20 | } from '../../../../shared/extra-utils' | 22 | } from '@shared/extra-utils' |
21 | import { | 23 | import { getGoodVideoUrl, getMagnetURI } from '@shared/extra-utils/videos/video-imports' |
22 | checkBadCountPagination, | 24 | import { VideoPrivacy } from '@shared/models' |
23 | checkBadSortPagination, | ||
24 | checkBadStartPagination | ||
25 | } from '../../../../shared/extra-utils/requests/check-api-params' | ||
26 | import { getGoodVideoUrl, getMagnetURI } from '../../../../shared/extra-utils/videos/video-imports' | ||
27 | import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' | ||
28 | 25 | ||
29 | describe('Test video imports API validator', function () { | 26 | describe('Test video imports API validator', function () { |
30 | const path = '/api/v1/videos/imports' | 27 | const path = '/api/v1/videos/imports' |
@@ -263,14 +260,16 @@ describe('Test video imports API validator', function () { | |||
263 | }) | 260 | }) |
264 | 261 | ||
265 | it('Should forbid to import http videos', async function () { | 262 | it('Should forbid to import http videos', async function () { |
266 | await updateCustomSubConfig(server.url, server.accessToken, { | 263 | await server.configCommand.updateCustomSubConfig({ |
267 | import: { | 264 | newConfig: { |
268 | videos: { | 265 | import: { |
269 | http: { | 266 | videos: { |
270 | enabled: false | 267 | http: { |
271 | }, | 268 | enabled: false |
272 | torrent: { | 269 | }, |
273 | enabled: true | 270 | torrent: { |
271 | enabled: true | ||
272 | } | ||
274 | } | 273 | } |
275 | } | 274 | } |
276 | } | 275 | } |
@@ -286,14 +285,16 @@ describe('Test video imports API validator', function () { | |||
286 | }) | 285 | }) |
287 | 286 | ||
288 | it('Should forbid to import torrent videos', async function () { | 287 | it('Should forbid to import torrent videos', async function () { |
289 | await updateCustomSubConfig(server.url, server.accessToken, { | 288 | await server.configCommand.updateCustomSubConfig({ |
290 | import: { | 289 | newConfig: { |
291 | videos: { | 290 | import: { |
292 | http: { | 291 | videos: { |
293 | enabled: true | 292 | http: { |
294 | }, | 293 | enabled: true |
295 | torrent: { | 294 | }, |
296 | enabled: false | 295 | torrent: { |
296 | enabled: false | ||
297 | } | ||
297 | } | 298 | } |
298 | } | 299 | } |
299 | } | 300 | } |