aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/moderation
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 16:49:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit6910f20f114b5bd020258a3a9a3f2117819a60c2 (patch)
tree0f50d33e20814b581dd9b2c175e511ac7a66f8df /server/tests/api/moderation
parent313228e9c3b5bcef5391228c9b949d05d32ad7bb (diff)
downloadPeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.tar.gz
PeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.tar.zst
PeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.zip
Introduce import command
Diffstat (limited to 'server/tests/api/moderation')
-rw-r--r--server/tests/api/moderation/video-blacklist.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tests/api/moderation/video-blacklist.ts b/server/tests/api/moderation/video-blacklist.ts
index 17a68e4a6..c72ebc16b 100644
--- a/server/tests/api/moderation/video-blacklist.ts
+++ b/server/tests/api/moderation/video-blacklist.ts
@@ -12,6 +12,7 @@ import {
12 getMyUserInformation, 12 getMyUserInformation,
13 getMyVideos, 13 getMyVideos,
14 getVideosList, 14 getVideosList,
15 ImportsCommand,
15 killallServers, 16 killallServers,
16 reRunServer, 17 reRunServer,
17 ServerInfo, 18 ServerInfo,
@@ -21,7 +22,6 @@ import {
21 userLogin, 22 userLogin,
22 waitJobs 23 waitJobs
23} from '@shared/extra-utils' 24} from '@shared/extra-utils'
24import { getGoodVideoUrl, getMagnetURI, importVideo } from '@shared/extra-utils/videos/video-imports'
25import { User, UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models' 25import { User, UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models'
26 26
27const expect = chai.expect 27const expect = chai.expect
@@ -402,11 +402,11 @@ describe('Test video blacklist', function () {
402 this.timeout(15000) 402 this.timeout(15000)
403 403
404 const attributes = { 404 const attributes = {
405 targetUrl: getGoodVideoUrl(), 405 targetUrl: ImportsCommand.getGoodVideoUrl(),
406 name: 'URL import', 406 name: 'URL import',
407 channelId: channelOfUserWithoutFlag 407 channelId: channelOfUserWithoutFlag
408 } 408 }
409 await importVideo(servers[0].url, userWithoutFlag, attributes) 409 await servers[0].importsCommand.importVideo({ token: userWithoutFlag, attributes })
410 410
411 const body = await command.list({ sort: 'createdAt', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED }) 411 const body = await command.list({ sort: 'createdAt', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED })
412 expect(body.total).to.equal(2) 412 expect(body.total).to.equal(2)
@@ -415,11 +415,11 @@ describe('Test video blacklist', function () {
415 415
416 it('Should auto blacklist a video on torrent import', async function () { 416 it('Should auto blacklist a video on torrent import', async function () {
417 const attributes = { 417 const attributes = {
418 magnetUri: getMagnetURI(), 418 magnetUri: ImportsCommand.getMagnetURI(),
419 name: 'Torrent import', 419 name: 'Torrent import',
420 channelId: channelOfUserWithoutFlag 420 channelId: channelOfUserWithoutFlag
421 } 421 }
422 await importVideo(servers[0].url, userWithoutFlag, attributes) 422 await servers[0].importsCommand.importVideo({ token: userWithoutFlag, attributes })
423 423
424 const body = await command.list({ sort: 'createdAt', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED }) 424 const body = await command.list({ sort: 'createdAt', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED })
425 expect(body.total).to.equal(3) 425 expect(body.total).to.equal(3)