X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Factivitypub%2Fclient.ts;h=34c6be49be9be139a418fa1b54baf16340d4a5ab;hb=8c559fad1e1c4c2ab7f1388c73200aa4c6256d74;hp=6d90d8643783d9e7718b7bf59d958b4e8fd1dbe9;hpb=73471b1a52f242e86364ffb077ea6cadb3b07ae2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 6d90d8643..34c6be49b 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -3,6 +3,7 @@ import * as chai from 'chai' import 'mocha' import { + cleanupTests, doubleFollow, flushAndRunMultipleServers, flushTests, @@ -11,7 +12,7 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils' +} 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) }) })