X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fmultiple-servers.ts;h=6238cdc0858e92e18e6f9d3ee7549ecd6896a923;hb=6b738c7a31591a83fdcd9c78b6b1f98e543c378b;hp=2563939ecdf4c24a5add56f22aacbdd9d6afe56b;hpb=9d3ef9fe052ed29bd67566754cb28662bd122234;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 2563939ec..6238cdc08 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts @@ -39,6 +39,7 @@ import { getVideoCommentThreads, getVideoThreadComments } from '../../utils/videos/video-comments' +import { getAccountsList } from '../../utils/users/accounts' const expect = chai.expect @@ -46,6 +47,7 @@ describe('Test multiple servers', function () { let servers: ServerInfo[] = [] const toRemove = [] let videoUUID = '' + let accountId: number let videoChannelId: number before(async function () { @@ -56,13 +58,20 @@ describe('Test multiple servers', function () { // Get the access tokens await setAccessTokensToServers(servers) - const videoChannel = { - name: 'my channel', - description: 'super channel' + { + const res = await getAccountsList(servers[0].url) + accountId = res.body.data[0].id + } + + { + const videoChannel = { + name: 'my channel', + description: 'super channel' + } + await addVideoChannel(servers[ 0 ].url, servers[ 0 ].accessToken, accountId, videoChannel) + const channelRes = await getVideoChannelsList(servers[ 0 ].url, 0, 1) + videoChannelId = channelRes.body.data[ 0 ].id } - await addVideoChannel(servers[0].url, servers[0].accessToken, videoChannel) - const channelRes = await getVideoChannelsList(servers[0].url, 0, 1) - videoChannelId = channelRes.body.data[0].id // Server 1 and server 2 follow each other await doubleFollow(servers[0], servers[1])