X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fmoderation%2Fblocklist.ts;h=089af8b159c0f45e198a8082ff4242c15277064c;hb=83903cb65d531a6b6b91715387493ba8312b264d;hp=9a4a3b3b9233777f22e331f12e4e509bbbab84d6;hpb=89d241a79c262b9775c233b73cff080043ebb5e6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.ts index 9a4a3b3b9..089af8b15 100644 --- a/server/tests/api/moderation/blocklist.ts +++ b/server/tests/api/moderation/blocklist.ts @@ -6,9 +6,9 @@ import { BlocklistCommand, cleanupTests, CommentsCommand, + createMultipleServers, doubleFollow, - flushAndRunMultipleServers, - ServerInfo, + PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' @@ -16,7 +16,7 @@ import { UserNotificationType } from '@shared/models' const expect = chai.expect -async function checkAllVideos (server: ServerInfo, token: string) { +async function checkAllVideos (server: PeerTubeServer, token: string) { { const { data } = await server.videos.listWithToken({ token }) expect(data).to.have.lengthOf(5) @@ -28,7 +28,7 @@ async function checkAllVideos (server: ServerInfo, token: string) { } } -async function checkAllComments (server: ServerInfo, token: string, videoUUID: string) { +async function checkAllComments (server: PeerTubeServer, token: string, videoUUID: string) { const { data } = await server.comments.listThreads({ videoId: videoUUID, start: 0, count: 25, sort: '-createdAt', token }) const threads = data.filter(t => t.isDeleted === false) @@ -41,8 +41,8 @@ async function checkAllComments (server: ServerInfo, token: string, videoUUID: s } async function checkCommentNotification ( - mainServer: ServerInfo, - comment: { server: ServerInfo, token: string, videoUUID: string, text: string }, + mainServer: PeerTubeServer, + comment: { server: PeerTubeServer, token: string, videoUUID: string, text: string }, check: 'presence' | 'absence' ) { const command = comment.server.comments @@ -63,7 +63,7 @@ async function checkCommentNotification ( } describe('Test blocklist', function () { - let servers: ServerInfo[] + let servers: PeerTubeServer[] let videoUUID1: string let videoUUID2: string let videoUUID3: string @@ -77,7 +77,7 @@ describe('Test blocklist', function () { before(async function () { this.timeout(120000) - servers = await flushAndRunMultipleServers(3) + servers = await createMultipleServers(3) await setAccessTokensToServers(servers) command = servers[0].blocklist @@ -690,7 +690,7 @@ describe('Test blocklist', function () { const now = new Date() await servers[1].follows.unfollow({ target: servers[0] }) await waitJobs(servers) - await servers[1].follows.follow({ targets: [ servers[0].host ] }) + await servers[1].follows.follow({ hosts: [ servers[0].host ] }) await waitJobs(servers) @@ -751,7 +751,7 @@ describe('Test blocklist', function () { const now = new Date() await servers[1].follows.unfollow({ target: servers[0] }) await waitJobs(servers) - await servers[1].follows.follow({ targets: [ servers[0].host ] }) + await servers[1].follows.follow({ hosts: [ servers[0].host ] }) await waitJobs(servers)