X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Factivitypub%2Ffetch.ts;h=3899a6a49c37d9bacb0d9df42a124a86ba1d9fc2;hb=d102de1b38f2877463529c3b27bd35ffef4fd8bf;hp=cc71e82eaa09c38c7941f04ea7c191cf96f9197a;hpb=3318147300b4f998adf728eb0a5a14a4c1829c51;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts index cc71e82ea..3899a6a49 100644 --- a/server/tests/api/activitypub/fetch.ts +++ b/server/tests/api/activitypub/fetch.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' -import * as chai from 'chai' +import { expect } from 'chai' +import { SQLCommand } from '@server/tests/shared' import { cleanupTests, createMultipleServers, @@ -11,10 +11,9 @@ import { waitJobs } from '@shared/server-commands' -const expect = chai.expect - describe('Test ActivityPub fetcher', function () { let servers: PeerTubeServer[] + let sqlCommandServer1: SQLCommand // --------------------------------------------------------------- @@ -37,15 +36,17 @@ describe('Test ActivityPub fetcher', function () { const { uuid } = await servers[0].videos.upload({ attributes: { name: 'bad video root' } }) await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'video user' } }) + sqlCommandServer1 = new SQLCommand(servers[0]) + { - const to = 'http://localhost:' + servers[0].port + '/accounts/user1' - const value = 'http://localhost:' + servers[1].port + '/accounts/user1' - await servers[0].sql.setActorField(to, 'url', value) + const to = servers[0].url + '/accounts/user1' + const value = servers[1].url + '/accounts/user1' + await sqlCommandServer1.setActorField(to, 'url', value) } { - const value = 'http://localhost:' + servers[2].port + '/videos/watch/' + uuid - await servers[0].sql.setVideoField(uuid, 'url', value) + const value = servers[2].url + '/videos/watch/' + uuid + await sqlCommandServer1.setVideoField(uuid, 'url', value) } }) @@ -75,6 +76,7 @@ describe('Test ActivityPub fetcher', function () { after(async function () { this.timeout(20000) + await sqlCommandServer1.cleanup() await cleanupTests(servers) }) })