aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/moderation/video-blacklist.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:47:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch)
treeeaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /server/tests/api/moderation/video-blacklist.ts
parent89d241a79c262b9775c233b73cff080043ebb5e6 (diff)
downloadPeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.gz
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.zst
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.zip
Use an object to represent a server
Diffstat (limited to 'server/tests/api/moderation/video-blacklist.ts')
-rw-r--r--server/tests/api/moderation/video-blacklist.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/server/tests/api/moderation/video-blacklist.ts b/server/tests/api/moderation/video-blacklist.ts
index d23d23bcb..62cbf2e07 100644
--- a/server/tests/api/moderation/video-blacklist.ts
+++ b/server/tests/api/moderation/video-blacklist.ts
@@ -7,11 +7,10 @@ import {
7 BlacklistCommand, 7 BlacklistCommand,
8 cleanupTests, 8 cleanupTests,
9 doubleFollow, 9 doubleFollow,
10 flushAndRunMultipleServers, 10 createMultipleServers,
11 ImportsCommand, 11 ImportsCommand,
12 killallServers, 12 killallServers,
13 reRunServer, 13 PeerTubeServer,
14 ServerInfo,
15 setAccessTokensToServers, 14 setAccessTokensToServers,
16 waitJobs 15 waitJobs
17} from '@shared/extra-utils' 16} from '@shared/extra-utils'
@@ -20,11 +19,11 @@ import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@sh
20const expect = chai.expect 19const expect = chai.expect
21 20
22describe('Test video blacklist', function () { 21describe('Test video blacklist', function () {
23 let servers: ServerInfo[] = [] 22 let servers: PeerTubeServer[] = []
24 let videoId: number 23 let videoId: number
25 let command: BlacklistCommand 24 let command: BlacklistCommand
26 25
27 async function blacklistVideosOnServer (server: ServerInfo) { 26 async function blacklistVideosOnServer (server: PeerTubeServer) {
28 const { data } = await server.videos.list() 27 const { data } = await server.videos.list()
29 28
30 for (const video of data) { 29 for (const video of data) {
@@ -36,7 +35,7 @@ describe('Test video blacklist', function () {
36 this.timeout(50000) 35 this.timeout(50000)
37 36
38 // Run servers 37 // Run servers
39 servers = await flushAndRunMultipleServers(2) 38 servers = await createMultipleServers(2)
40 39
41 // Get the access tokens 40 // Get the access tokens
42 await setAccessTokensToServers(servers) 41 await setAccessTokensToServers(servers)
@@ -344,7 +343,7 @@ describe('Test video blacklist', function () {
344 } 343 }
345 } 344 }
346 } 345 }
347 await reRunServer(servers[0], config) 346 await servers[0].run(config)
348 347
349 { 348 {
350 const user = { username: 'user_without_flag', password: 'password' } 349 const user = { username: 'user_without_flag', password: 'password' }