X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Factivitypub%2Fclient.ts;h=34c6be49be9be139a418fa1b54baf16340d4a5ab;hb=8c559fad1e1c4c2ab7f1388c73200aa4c6256d74;hp=ea0682634f30d8d8ea6df952b0d97bc3fe9295c8;hpb=1a8dd4da77468068d1ff7f7bd67f76399ae04e04;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index ea0682634..34c6be49b 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -3,15 +3,16 @@ import * as chai from 'chai' import 'mocha' import { + cleanupTests, doubleFollow, flushAndRunMultipleServers, flushTests, killallServers, makeActivityPubGetRequest, - runServer, ServerInfo, - setAccessTokensToServers, uploadVideo -} from '../../utils' + setAccessTokensToServers, + uploadVideo +} from '../../../../shared/extra-utils' const expect = chai.expect @@ -22,8 +23,6 @@ describe('Test activitypub', function () { before(async function () { this.timeout(30000) - await flushTests() - servers = await flushAndRunMultipleServers(2) await setAccessTokensToServers(servers) @@ -41,7 +40,7 @@ describe('Test activitypub', function () { const object = res.body expect(object.type).to.equal('Person') - expect(object.id).to.equal('http://localhost:9001/accounts/root') + expect(object.id).to.equal('http://localhost:' + servers[0].port + '/accounts/root') expect(object.name).to.equal('root') expect(object.preferredUsername).to.equal('root') }) @@ -51,17 +50,17 @@ describe('Test activitypub', function () { const object = res.body expect(object.type).to.equal('Video') - expect(object.id).to.equal('http://localhost:9001/videos/watch/' + videoUUID) + expect(object.id).to.equal('http://localhost:' + servers[0].port + '/videos/watch/' + videoUUID) expect(object.name).to.equal('video') }) it('Should redirect to the origin video object', async function () { const res = await makeActivityPubGetRequest(servers[1].url, '/videos/watch/' + videoUUID, 302) - expect(res.header.location).to.equal('http://localhost:9001/videos/watch/' + videoUUID) + expect(res.header.location).to.equal('http://localhost:' + servers[0].port + '/videos/watch/' + videoUUID) }) after(async function () { - killallServers(servers) + await cleanupTests(servers) }) })