X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-schedule-update.ts;h=3f77387842d1455f0441be17043ebc6d2bf4ebb9;hb=171efc48e67498406feb6d7873b3482b41505515;hp=635ae6ff1bd0019ec62349ee693cd958f63beebe;hpb=d23dd9fbfc4d26026352c10f81d2795ceaf2908a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts index 635ae6ff1..3f7738784 100644 --- a/server/tests/api/videos/video-schedule-update.ts +++ b/server/tests/api/videos/video-schedule-update.ts @@ -4,9 +4,9 @@ import 'mocha' import * as chai from 'chai' import { cleanupTests, + createMultipleServers, doubleFollow, - flushAndRunMultipleServers, - ServerInfo, + PeerTubeServer, setAccessTokensToServers, wait, waitJobs @@ -23,14 +23,14 @@ function in10Seconds () { } describe('Test video update scheduler', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let video2UUID: string before(async function () { this.timeout(30000) // Run servers - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) await setAccessTokensToServers(servers) @@ -49,25 +49,25 @@ describe('Test video update scheduler', function () { } } - await servers[0].videosCommand.upload({ attributes }) + await servers[0].videos.upload({ attributes }) await waitJobs(servers) }) it('Should not list the video (in privacy mode)', async function () { for (const server of servers) { - const { total } = await server.videosCommand.list() + const { total } = await server.videos.list() expect(total).to.equal(0) } }) it('Should have my scheduled video in my account videos', async function () { - const { total, data } = await servers[0].videosCommand.listMyVideos() + const { total, data } = await servers[0].videos.listMyVideos() expect(total).to.equal(1) const videoFromList = data[0] - const videoFromGet = await servers[0].videosCommand.getWithToken({ id: videoFromList.uuid }) + const videoFromGet = await servers[0].videos.getWithToken({ id: videoFromList.uuid }) for (const video of [ videoFromList, videoFromGet ]) { expect(video.name).to.equal('video 1') @@ -84,7 +84,7 @@ describe('Test video update scheduler', function () { await waitJobs(servers) for (const server of servers) { - const { total, data } = await server.videosCommand.list() + const { total, data } = await server.videos.list() expect(total).to.equal(1) expect(data[0].name).to.equal('video 1') @@ -99,7 +99,7 @@ describe('Test video update scheduler', function () { privacy: VideoPrivacy.PRIVATE } - const { uuid } = await servers[0].videosCommand.upload({ attributes }) + const { uuid } = await servers[0].videos.upload({ attributes }) video2UUID = uuid await waitJobs(servers) @@ -116,20 +116,20 @@ describe('Test video update scheduler', function () { } } - await servers[0].videosCommand.update({ id: video2UUID, attributes }) + await servers[0].videos.update({ id: video2UUID, attributes }) await waitJobs(servers) }) it('Should not display the updated video', async function () { for (const server of servers) { - const { total } = await server.videosCommand.list() + const { total } = await server.videos.list() expect(total).to.equal(1) } }) it('Should have my scheduled updated video in my account videos', async function () { - const { total, data } = await servers[0].videosCommand.listMyVideos() + const { total, data } = await servers[0].videos.listMyVideos() expect(total).to.equal(2) const video = data.find(v => v.uuid === video2UUID) @@ -149,7 +149,7 @@ describe('Test video update scheduler', function () { await waitJobs(servers) for (const server of servers) { - const { total, data } = await server.videosCommand.list() + const { total, data } = await server.videos.list() expect(total).to.equal(2) const video = data.find(v => v.uuid === video2UUID)