aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/moderation/blocklist.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/blocklist.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/blocklist.ts')
-rw-r--r--server/tests/api/moderation/blocklist.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.ts
index 9a4a3b3b9..593291e87 100644
--- a/server/tests/api/moderation/blocklist.ts
+++ b/server/tests/api/moderation/blocklist.ts
@@ -7,8 +7,8 @@ import {
7 cleanupTests, 7 cleanupTests,
8 CommentsCommand, 8 CommentsCommand,
9 doubleFollow, 9 doubleFollow,
10 flushAndRunMultipleServers, 10 createMultipleServers,
11 ServerInfo, 11 PeerTubeServer,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 waitJobs 13 waitJobs
14} from '@shared/extra-utils' 14} from '@shared/extra-utils'
@@ -16,7 +16,7 @@ import { UserNotificationType } from '@shared/models'
16 16
17const expect = chai.expect 17const expect = chai.expect
18 18
19async function checkAllVideos (server: ServerInfo, token: string) { 19async function checkAllVideos (server: PeerTubeServer, token: string) {
20 { 20 {
21 const { data } = await server.videos.listWithToken({ token }) 21 const { data } = await server.videos.listWithToken({ token })
22 expect(data).to.have.lengthOf(5) 22 expect(data).to.have.lengthOf(5)
@@ -28,7 +28,7 @@ async function checkAllVideos (server: ServerInfo, token: string) {
28 } 28 }
29} 29}
30 30
31async function checkAllComments (server: ServerInfo, token: string, videoUUID: string) { 31async function checkAllComments (server: PeerTubeServer, token: string, videoUUID: string) {
32 const { data } = await server.comments.listThreads({ videoId: videoUUID, start: 0, count: 25, sort: '-createdAt', token }) 32 const { data } = await server.comments.listThreads({ videoId: videoUUID, start: 0, count: 25, sort: '-createdAt', token })
33 33
34 const threads = data.filter(t => t.isDeleted === false) 34 const threads = data.filter(t => t.isDeleted === false)
@@ -41,8 +41,8 @@ async function checkAllComments (server: ServerInfo, token: string, videoUUID: s
41} 41}
42 42
43async function checkCommentNotification ( 43async function checkCommentNotification (
44 mainServer: ServerInfo, 44 mainServer: PeerTubeServer,
45 comment: { server: ServerInfo, token: string, videoUUID: string, text: string }, 45 comment: { server: PeerTubeServer, token: string, videoUUID: string, text: string },
46 check: 'presence' | 'absence' 46 check: 'presence' | 'absence'
47) { 47) {
48 const command = comment.server.comments 48 const command = comment.server.comments
@@ -63,7 +63,7 @@ async function checkCommentNotification (
63} 63}
64 64
65describe('Test blocklist', function () { 65describe('Test blocklist', function () {
66 let servers: ServerInfo[] 66 let servers: PeerTubeServer[]
67 let videoUUID1: string 67 let videoUUID1: string
68 let videoUUID2: string 68 let videoUUID2: string
69 let videoUUID3: string 69 let videoUUID3: string
@@ -77,7 +77,7 @@ describe('Test blocklist', function () {
77 before(async function () { 77 before(async function () {
78 this.timeout(120000) 78 this.timeout(120000)
79 79
80 servers = await flushAndRunMultipleServers(3) 80 servers = await createMultipleServers(3)
81 await setAccessTokensToServers(servers) 81 await setAccessTokensToServers(servers)
82 82
83 command = servers[0].blocklist 83 command = servers[0].blocklist