X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fmoderation%2Fvideo-blacklist.ts;h=d5838191ad47c04ba37d8b572e30ac0515f1ff95;hb=171efc48e67498406feb6d7873b3482b41505515;hp=d23d23bcbf6103b90eba8930569758bd44de529b;hpb=89d241a79c262b9775c233b73cff080043ebb5e6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/moderation/video-blacklist.ts b/server/tests/api/moderation/video-blacklist.ts index d23d23bcb..d5838191a 100644 --- a/server/tests/api/moderation/video-blacklist.ts +++ b/server/tests/api/moderation/video-blacklist.ts @@ -6,12 +6,11 @@ import { orderBy } from 'lodash' import { BlacklistCommand, cleanupTests, + createMultipleServers, doubleFollow, - flushAndRunMultipleServers, - ImportsCommand, + FIXTURE_URLS, killallServers, - reRunServer, - ServerInfo, + PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' @@ -20,11 +19,11 @@ import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@sh const expect = chai.expect describe('Test video blacklist', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let videoId: number let command: BlacklistCommand - async function blacklistVideosOnServer (server: ServerInfo) { + async function blacklistVideosOnServer (server: PeerTubeServer) { const { data } = await server.videos.list() for (const video of data) { @@ -36,7 +35,7 @@ describe('Test video blacklist', function () { this.timeout(50000) // Run servers - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) // Get the access tokens await setAccessTokensToServers(servers) @@ -344,7 +343,7 @@ describe('Test video blacklist', function () { } } } - await reRunServer(servers[0], config) + await servers[0].run(config) { const user = { username: 'user_without_flag', password: 'password' } @@ -388,7 +387,7 @@ describe('Test video blacklist', function () { this.timeout(15000) const attributes = { - targetUrl: ImportsCommand.getGoodVideoUrl(), + targetUrl: FIXTURE_URLS.goodVideo, name: 'URL import', channelId: channelOfUserWithoutFlag } @@ -401,7 +400,7 @@ describe('Test video blacklist', function () { it('Should auto blacklist a video on torrent import', async function () { const attributes = { - magnetUri: ImportsCommand.getMagnetURI(), + magnetUri: FIXTURE_URLS.magnet, name: 'Torrent import', channelId: channelOfUserWithoutFlag }