X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-channels.ts;h=f091484049ba5548c3e397db31c20fa9aa522e07;hb=7243f84db0f34c6d5610a54603b0cce7c284a7b3;hp=41429a3d85f8b11f43d72354333a0c62ae4c8f05;hpb=d175a6f7ab9dd53e36f9f52769ac02dbfdc57e3e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index 41429a3d8..f09148404 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts @@ -4,6 +4,7 @@ import * as chai from 'chai' import 'mocha' import { User, Video } from '../../../../shared/index' import { + cleanupTests, createUser, doubleFollow, flushAndRunMultipleServers, @@ -13,7 +14,7 @@ import { updateVideoChannelAvatar, uploadVideo, userLogin -} from '../../utils' +} from '../../../../shared/extra-utils' import { addVideoChannel, deleteVideoChannel, @@ -26,8 +27,8 @@ import { ServerInfo, setAccessTokensToServers, updateVideoChannel -} from '../../utils/index' -import { waitJobs } from '../../utils/server/jobs' +} from '../../../../shared/extra-utils/index' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect @@ -42,8 +43,6 @@ describe('Test video channels', function () { before(async function () { this.timeout(30000) - await flushTests() - servers = await flushAndRunMultipleServers(2) await setAccessTokensToServers(servers) @@ -214,7 +213,7 @@ describe('Test video channels', function () { this.timeout(10000) for (const server of servers) { - const channelURI = 'second_video_channel@localhost:9001' + const channelURI = 'second_video_channel@localhost:' + server.port const res1 = await getVideoChannelVideos(server.url, server.accessToken, channelURI, 0, 5) expect(res1.body.total).to.equal(1) expect(res1.body.data).to.be.an('array') @@ -235,11 +234,11 @@ describe('Test video channels', function () { this.timeout(10000) for (const server of servers) { - const secondChannelURI = 'second_video_channel@localhost:9001' + const secondChannelURI = 'second_video_channel@localhost:' + server.port const res1 = await getVideoChannelVideos(server.url, server.accessToken, secondChannelURI, 0, 5) expect(res1.body.total).to.equal(0) - const channelURI = 'root_channel@localhost:9001' + const channelURI = 'root_channel@localhost:' + server.port const res2 = await getVideoChannelVideos(server.url, server.accessToken, channelURI, 0, 5) expect(res2.body.total).to.equal(1) @@ -270,7 +269,7 @@ describe('Test video channels', function () { } { - await createUser(servers[ 0 ].url, servers[ 0 ].accessToken, 'toto', 'password') + await createUser({ url: servers[ 0 ].url, accessToken: servers[ 0 ].accessToken, username: 'toto', password: 'password' }) const accessToken = await userLogin(servers[ 0 ], { username: 'toto', password: 'password' }) const res = await getMyUserInformation(servers[ 0 ].url, accessToken) @@ -280,6 +279,6 @@ describe('Test video channels', function () { }) after(async function () { - killallServers(servers) + await cleanupTests(servers) }) })