X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Ftests%2Fapi%2Factivitypub%2Ffetch.ts;h=3899a6a49c37d9bacb0d9df42a124a86ba1d9fc2;hb=d102de1b38f2877463529c3b27bd35ffef4fd8bf;hp=422a75d6e1814ec802f66694c6d59ae878ad7975;hpb=c4fa01f7c45b66b112ebd08abce744b7c4041feb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts index 422a75d6e..3899a6a49 100644 --- a/server/tests/api/activitypub/fetch.ts +++ b/server/tests/api/activitypub/fetch.ts @@ -1,13 +1,19 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' -import * as chai from 'chai' -import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' - -const expect = chai.expect +import { expect } from 'chai' +import { SQLCommand } from '@server/tests/shared' +import { + cleanupTests, + createMultipleServers, + doubleFollow, + PeerTubeServer, + setAccessTokensToServers, + waitJobs +} from '@shared/server-commands' describe('Test ActivityPub fetcher', function () { let servers: PeerTubeServer[] + let sqlCommandServer1: SQLCommand // --------------------------------------------------------------- @@ -30,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) } }) @@ -68,6 +76,7 @@ describe('Test ActivityPub fetcher', function () { after(async function () { this.timeout(20000) + await sqlCommandServer1.cleanup() await cleanupTests(servers) }) })