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.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index 87c385f38..a7fd4c8a6 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -27,6 +27,7 @@ type VideoAttributes = {
27 language?: string 27 language?: string
28 nsfw?: boolean 28 nsfw?: boolean
29 commentsEnabled?: boolean 29 commentsEnabled?: boolean
30 downloadingEnabled?: boolean
30 waitTranscoding?: boolean 31 waitTranscoding?: boolean
31 description?: string 32 description?: string
32 tags?: string[] 33 tags?: string[]
@@ -310,6 +311,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
310 tags: [ 'tag' ], 311 tags: [ 'tag' ],
311 privacy: VideoPrivacy.PUBLIC, 312 privacy: VideoPrivacy.PUBLIC,
312 commentsEnabled: true, 313 commentsEnabled: true,
314 downloadingEnabled: true,
313 fixture: 'video_short.webm' 315 fixture: 'video_short.webm'
314 }, videoAttributesArg) 316 }, videoAttributesArg)
315 317
@@ -320,6 +322,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
320 .field('name', attributes.name) 322 .field('name', attributes.name)
321 .field('nsfw', JSON.stringify(attributes.nsfw)) 323 .field('nsfw', JSON.stringify(attributes.nsfw))
322 .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled)) 324 .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled))
325 .field('downloadingEnabled', JSON.stringify(attributes.downloadingEnabled))
323 .field('waitTranscoding', JSON.stringify(attributes.waitTranscoding)) 326 .field('waitTranscoding', JSON.stringify(attributes.waitTranscoding))
324 .field('privacy', attributes.privacy.toString()) 327 .field('privacy', attributes.privacy.toString())
325 .field('channelId', attributes.channelId) 328 .field('channelId', attributes.channelId)
@@ -370,6 +373,7 @@ function updateVideo (url: string, accessToken: string, id: number | string, att
370 if (attributes.language) body['language'] = attributes.language 373 if (attributes.language) body['language'] = attributes.language
371 if (attributes.nsfw !== undefined) body['nsfw'] = JSON.stringify(attributes.nsfw) 374 if (attributes.nsfw !== undefined) body['nsfw'] = JSON.stringify(attributes.nsfw)
372 if (attributes.commentsEnabled !== undefined) body['commentsEnabled'] = JSON.stringify(attributes.commentsEnabled) 375 if (attributes.commentsEnabled !== undefined) body['commentsEnabled'] = JSON.stringify(attributes.commentsEnabled)
376 if (attributes.downloadingEnabled !== undefined) body['downloadingEnabled'] = JSON.stringify(attributes.downloadingEnabled)
373 if (attributes.description) body['description'] = attributes.description 377 if (attributes.description) body['description'] = attributes.description
374 if (attributes.tags) body['tags'] = attributes.tags 378 if (attributes.tags) body['tags'] = attributes.tags
375 if (attributes.privacy) body['privacy'] = attributes.privacy 379 if (attributes.privacy) body['privacy'] = attributes.privacy
@@ -435,6 +439,7 @@ async function completeVideoCheck (
435 language: string 439 language: string
436 nsfw: boolean 440 nsfw: boolean
437 commentsEnabled: boolean 441 commentsEnabled: boolean
442 downloadingEnabled: boolean
438 description: string 443 description: string
439 publishedAt?: string 444 publishedAt?: string
440 support: string 445 support: string
@@ -509,6 +514,7 @@ async function completeVideoCheck (
509 expect(dateIsValid(videoDetails.channel.createdAt.toString())).to.be.true 514 expect(dateIsValid(videoDetails.channel.createdAt.toString())).to.be.true
510 expect(dateIsValid(videoDetails.channel.updatedAt.toString())).to.be.true 515 expect(dateIsValid(videoDetails.channel.updatedAt.toString())).to.be.true
511 expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled) 516 expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled)
517 expect(videoDetails.downloadingEnabled).to.equal(attributes.downloadingEnabled)
512 518
513 for (const attributeFile of attributes.files) { 519 for (const attributeFile of attributes.files) {
514 const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution) 520 const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution)