aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/videos')
-rw-r--r--server/tests/utils/videos/videos.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index 2c1d20ef1..4f7ce6d6b 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -35,6 +35,10 @@ type VideoAttributes = {
35 fixture?: string 35 fixture?: string
36 thumbnailfile?: string 36 thumbnailfile?: string
37 previewfile?: string 37 previewfile?: string
38 scheduleUpdate?: {
39 updateAt: string
40 privacy?: VideoPrivacy
41 }
38} 42}
39 43
40function getVideoCategories (url: string) { 44function getVideoCategories (url: string) {
@@ -371,6 +375,14 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
371 req.attach('previewfile', buildAbsoluteFixturePath(attributes.previewfile)) 375 req.attach('previewfile', buildAbsoluteFixturePath(attributes.previewfile))
372 } 376 }
373 377
378 if (attributes.scheduleUpdate) {
379 req.field('scheduleUpdate[updateAt]', attributes.scheduleUpdate.updateAt)
380
381 if (attributes.scheduleUpdate.privacy) {
382 req.field('scheduleUpdate[privacy]', attributes.scheduleUpdate.privacy)
383 }
384 }
385
374 return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture)) 386 return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture))
375 .expect(specialStatus) 387 .expect(specialStatus)
376} 388}
@@ -389,6 +401,7 @@ function updateVideo (url: string, accessToken: string, id: number | string, att
389 if (attributes.tags) body['tags'] = attributes.tags 401 if (attributes.tags) body['tags'] = attributes.tags
390 if (attributes.privacy) body['privacy'] = attributes.privacy 402 if (attributes.privacy) body['privacy'] = attributes.privacy
391 if (attributes.channelId) body['channelId'] = attributes.channelId 403 if (attributes.channelId) body['channelId'] = attributes.channelId
404 if (attributes.scheduleUpdate) body['scheduleUpdate'] = attributes.scheduleUpdate
392 405
393 // Upload request 406 // Upload request
394 if (attributes.thumbnailfile || attributes.previewfile) { 407 if (attributes.thumbnailfile || attributes.previewfile) {