aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-schedule-update.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-15 16:52:15 +0200
committerChocobozzz <me@florianbigard.com>2018-06-15 18:20:56 +0200
commitbbe0f0645ca958d33a3f409b15166609733b663f (patch)
treeedcd5d702c73cda74a2177c4bdc08c616334337d /server/tests/api/videos/video-schedule-update.ts
parent2baea0c77cc765f7cbca9c9a2f4272268892a35c (diff)
downloadPeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.gz
PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.zst
PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.zip
Add ability to schedule video publication
Diffstat (limited to 'server/tests/api/videos/video-schedule-update.ts')
-rw-r--r--server/tests/api/videos/video-schedule-update.ts26
1 files changed, 17 insertions, 9 deletions
diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts
index 8b87ea855..a260fa4da 100644
--- a/server/tests/api/videos/video-schedule-update.ts
+++ b/server/tests/api/videos/video-schedule-update.ts
@@ -5,11 +5,14 @@ import 'mocha'
5import { VideoPrivacy } from '../../../../shared/models/videos' 5import { VideoPrivacy } from '../../../../shared/models/videos'
6import { 6import {
7 doubleFollow, 7 doubleFollow,
8 flushAndRunMultipleServers, getMyVideos, 8 flushAndRunMultipleServers,
9 getMyVideos,
9 getVideosList, 10 getVideosList,
11 getVideoWithToken,
10 killallServers, 12 killallServers,
11 ServerInfo, 13 ServerInfo,
12 setAccessTokensToServers, updateVideo, 14 setAccessTokensToServers,
15 updateVideo,
13 uploadVideo, 16 uploadVideo,
14 wait 17 wait
15} from '../../utils' 18} from '../../utils'
@@ -69,17 +72,22 @@ describe('Test video update scheduler', function () {
69 const res = await getMyVideos(servers[0].url, servers[0].accessToken, 0, 5) 72 const res = await getMyVideos(servers[0].url, servers[0].accessToken, 0, 5)
70 expect(res.body.total).to.equal(1) 73 expect(res.body.total).to.equal(1)
71 74
72 const video = res.body.data[0] 75 const videoFromList = res.body.data[0]
73 expect(video.name).to.equal('video 1') 76 const res2 = await getVideoWithToken(servers[0].url, servers[0].accessToken, videoFromList.uuid)
74 expect(video.privacy.id).to.equal(VideoPrivacy.PRIVATE) 77 const videoFromGet = res2.body
75 expect(new Date(video.scheduledUpdate.updateAt)).to.be.above(new Date()) 78
76 expect(video.scheduledUpdate.privacy).to.equal(VideoPrivacy.PUBLIC) 79 for (const video of [ videoFromList, videoFromGet ]) {
80 expect(video.name).to.equal('video 1')
81 expect(video.privacy.id).to.equal(VideoPrivacy.PRIVATE)
82 expect(new Date(video.scheduledUpdate.updateAt)).to.be.above(new Date())
83 expect(video.scheduledUpdate.privacy).to.equal(VideoPrivacy.PUBLIC)
84 }
77 }) 85 })
78 86
79 it('Should wait some seconds and have the video in public privacy', async function () { 87 it('Should wait some seconds and have the video in public privacy', async function () {
80 this.timeout(20000) 88 this.timeout(20000)
81 89
82 await wait(10000) 90 await wait(15000)
83 await waitJobs(servers) 91 await waitJobs(servers)
84 92
85 for (const server of servers) { 93 for (const server of servers) {
@@ -144,7 +152,7 @@ describe('Test video update scheduler', function () {
144 it('Should wait some seconds and have the updated video in public privacy', async function () { 152 it('Should wait some seconds and have the updated video in public privacy', async function () {
145 this.timeout(20000) 153 this.timeout(20000)
146 154
147 await wait(10000) 155 await wait(15000)
148 await waitJobs(servers) 156 await waitJobs(servers)
149 157
150 for (const server of servers) { 158 for (const server of servers) {