diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:47:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch) | |
tree | eaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /server/tests/api/moderation/blocklist.ts | |
parent | 89d241a79c262b9775c233b73cff080043ebb5e6 (diff) | |
download | PeerTube-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.ts | 16 |
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 | ||
17 | const expect = chai.expect | 17 | const expect = chai.expect |
18 | 18 | ||
19 | async function checkAllVideos (server: ServerInfo, token: string) { | 19 | async 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 | ||
31 | async function checkAllComments (server: ServerInfo, token: string, videoUUID: string) { | 31 | async 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 | ||
43 | async function checkCommentNotification ( | 43 | async 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 | ||
65 | describe('Test blocklist', function () { | 65 | describe('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 |