X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Factivitypub%2Ffetch.ts;h=d5e21404c39eeed956022697f6f17142ef8a33a5;hb=6c5065a011b099618681a37bd77eaa7bd3db752e;hp=7240bb0fb494ebac59ddb0eabb8d413b2d927cab;hpb=97567dd81f508dd6295ac4d73d849aa2ce0a6549;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts index 7240bb0fb..d5e21404c 100644 --- a/server/tests/api/activitypub/fetch.ts +++ b/server/tests/api/activitypub/fetch.ts @@ -1,24 +1,19 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' - +import * as chai from 'chai' import { - closeAllSequelize, + cleanupTests, createUser, doubleFollow, flushAndRunMultipleServers, - flushTests, getVideosListSort, - killallServers, ServerInfo, setAccessTokensToServers, - setActorField, - setVideoField, uploadVideo, userLogin, waitJobs } from '../../../../shared/extra-utils' -import * as chai from 'chai' import { Video } from '../../../../shared/models/videos' const expect = chai.expect @@ -48,8 +43,16 @@ describe('Test ActivityPub fetcher', function () { const badVideoUUID = res.body.video.uuid await uploadVideo(servers[0].url, userAccessToken, { name: 'video user' }) - await setActorField(1, 'http://localhost:9001/accounts/user1', 'url', 'http://localhost:9002/accounts/user1') - await setVideoField(1, badVideoUUID, 'url', 'http://localhost:9003/videos/watch/' + badVideoUUID) + { + const to = 'http://localhost:' + servers[0].port + '/accounts/user1' + const value = 'http://localhost:' + servers[1].port + '/accounts/user1' + await servers[0].sqlCommand.setActorField(to, 'url', value) + } + + { + const value = 'http://localhost:' + servers[2].port + '/videos/watch/' + badVideoUUID + await servers[0].sqlCommand.setVideoField(badVideoUUID, 'url', value) + } }) it('Should add only the video with a valid actor URL', async function () { @@ -78,8 +81,8 @@ describe('Test ActivityPub fetcher', function () { }) after(async function () { - killallServers(servers) + this.timeout(20000) - await closeAllSequelize(servers) + await cleanupTests(servers) }) })