X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Ffollows-moderation.ts;h=a82acdb34a4c8417e7e1e770337873f27259379a;hb=48f07b4a4091cb10dc4d179118e155f3a118dca8;hp=2a3a4d5c823516c1ddc9e5147bcad733c9d192a6;hpb=7c3b79768bd174b22154e8d2df0b1211e01ee56a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/follows-moderation.ts b/server/tests/api/server/follows-moderation.ts index 2a3a4d5c8..a82acdb34 100644 --- a/server/tests/api/server/follows-moderation.ts +++ b/server/tests/api/server/follows-moderation.ts @@ -3,9 +3,9 @@ import * as chai from 'chai' import 'mocha' import { - acceptFollower, cleanupTests, + acceptFollower, + cleanupTests, flushAndRunMultipleServers, - killallServers, ServerInfo, setAccessTokensToServers, updateCustomSubConfig @@ -14,8 +14,8 @@ import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, - removeFollower, - rejectFollower + rejectFollower, + removeFollower } from '../../../../shared/extra-utils/server/follows' import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { ActorFollow } from '../../../../shared/models/actors' @@ -29,8 +29,8 @@ async function checkServer1And2HasFollowers (servers: ServerInfo[], state = 'acc const follow = res.body.data[0] as ActorFollow expect(follow.state).to.equal(state) - expect(follow.follower.url).to.equal('http://localhost:9001/accounts/peertube') - expect(follow.following.url).to.equal('http://localhost:9002/accounts/peertube') + expect(follow.follower.url).to.equal('http://localhost:' + servers[0].port + '/accounts/peertube') + expect(follow.following.url).to.equal('http://localhost:' + servers[1].port + '/accounts/peertube') } { @@ -39,8 +39,8 @@ async function checkServer1And2HasFollowers (servers: ServerInfo[], state = 'acc const follow = res.body.data[0] as ActorFollow expect(follow.state).to.equal(state) - expect(follow.follower.url).to.equal('http://localhost:9001/accounts/peertube') - expect(follow.following.url).to.equal('http://localhost:9002/accounts/peertube') + expect(follow.follower.url).to.equal('http://localhost:' + servers[0].port + '/accounts/peertube') + expect(follow.following.url).to.equal('http://localhost:' + servers[1].port + '/accounts/peertube') } } @@ -151,7 +151,7 @@ describe('Test follows moderation', function () { }) it('Should accept a follower', async function () { - await acceptFollower(servers[1].url, servers[1].accessToken, 'peertube@localhost:9001') + await acceptFollower(servers[1].url, servers[1].accessToken, 'peertube@localhost:' + servers[0].port) await waitJobs(servers) await checkServer1And2HasFollowers(servers) @@ -178,7 +178,7 @@ describe('Test follows moderation', function () { expect(res.body.total).to.equal(1) } - await rejectFollower(servers[2].url, servers[2].accessToken, 'peertube@localhost:9001') + await rejectFollower(servers[2].url, servers[2].accessToken, 'peertube@localhost:' + servers[0].port) await waitJobs(servers) await checkServer1And2HasFollowers(servers)