From 6910f20f114b5bd020258a3a9a3f2117819a60c2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 8 Jul 2021 16:49:51 +0200 Subject: Introduce import command --- server/tests/api/moderation/video-blacklist.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/tests/api/moderation') 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 { getMyUserInformation, getMyVideos, getVideosList, + ImportsCommand, killallServers, reRunServer, ServerInfo, @@ -21,7 +22,6 @@ import { userLogin, waitJobs } from '@shared/extra-utils' -import { getGoodVideoUrl, getMagnetURI, importVideo } from '@shared/extra-utils/videos/video-imports' import { User, UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models' const expect = chai.expect @@ -402,11 +402,11 @@ describe('Test video blacklist', function () { this.timeout(15000) const attributes = { - targetUrl: getGoodVideoUrl(), + targetUrl: ImportsCommand.getGoodVideoUrl(), name: 'URL import', channelId: channelOfUserWithoutFlag } - await importVideo(servers[0].url, userWithoutFlag, attributes) + await servers[0].importsCommand.importVideo({ token: userWithoutFlag, attributes }) const body = await command.list({ sort: 'createdAt', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED }) expect(body.total).to.equal(2) @@ -415,11 +415,11 @@ describe('Test video blacklist', function () { it('Should auto blacklist a video on torrent import', async function () { const attributes = { - magnetUri: getMagnetURI(), + magnetUri: ImportsCommand.getMagnetURI(), name: 'Torrent import', channelId: channelOfUserWithoutFlag } - await importVideo(servers[0].url, userWithoutFlag, attributes) + await servers[0].importsCommand.importVideo({ token: userWithoutFlag, attributes }) const body = await command.list({ sort: 'createdAt', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED }) expect(body.total).to.equal(3) -- cgit v1.2.3