aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-19 11:04:40 +0100
committerChocobozzz <me@florianbigard.com>2018-03-19 11:04:40 +0100
commit09700934b90e2ac7b1b9ed1694d9d4d52735e2e1 (patch)
tree29ea9512fa34676a7194e9cb37d912b38266c9cc /server/tests/utils/videos
parentae5a3dd6642c8d5abc87b874496026dc9ed37d2d (diff)
downloadPeerTube-09700934b90e2ac7b1b9ed1694d9d4d52735e2e1.tar.gz
PeerTube-09700934b90e2ac7b1b9ed1694d9d4d52735e2e1.tar.zst
PeerTube-09700934b90e2ac7b1b9ed1694d9d4d52735e2e1.zip
BEARKING CHANGE: Update videos API response
before beta
Diffstat (limited to 'server/tests/utils/videos')
-rw-r--r--server/tests/utils/videos/videos.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index 89db16fec..3c63bedb2 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -407,12 +407,12 @@ async function completeVideoCheck (
407 if (!attributes.dislikes) attributes.dislikes = 0 407 if (!attributes.dislikes) attributes.dislikes = 0
408 408
409 expect(video.name).to.equal(attributes.name) 409 expect(video.name).to.equal(attributes.name)
410 expect(video.category).to.equal(attributes.category) 410 expect(video.category.id).to.equal(attributes.category)
411 expect(video.categoryLabel).to.equal(VIDEO_CATEGORIES[attributes.category] || 'Misc') 411 expect(video.category.label).to.equal(VIDEO_CATEGORIES[attributes.category] || 'Misc')
412 expect(video.licence).to.equal(attributes.licence) 412 expect(video.licence.id).to.equal(attributes.licence)
413 expect(video.licenceLabel).to.equal(VIDEO_LICENCES[attributes.licence] || 'Unknown') 413 expect(video.licence.label).to.equal(VIDEO_LICENCES[attributes.licence] || 'Unknown')
414 expect(video.language).to.equal(attributes.language) 414 expect(video.language.id).to.equal(attributes.language)
415 expect(video.languageLabel).to.equal(VIDEO_LANGUAGES[attributes.language] || 'Unknown') 415 expect(video.language.label).to.equal(VIDEO_LANGUAGES[attributes.language] || 'Unknown')
416 expect(video.nsfw).to.equal(attributes.nsfw) 416 expect(video.nsfw).to.equal(attributes.nsfw)
417 expect(video.description).to.equal(attributes.description) 417 expect(video.description).to.equal(attributes.description)
418 expect(video.account.host).to.equal(attributes.account.host) 418 expect(video.account.host).to.equal(attributes.account.host)
@@ -429,8 +429,8 @@ async function completeVideoCheck (
429 429
430 expect(videoDetails.files).to.have.lengthOf(attributes.files.length) 430 expect(videoDetails.files).to.have.lengthOf(attributes.files.length)
431 expect(videoDetails.tags).to.deep.equal(attributes.tags) 431 expect(videoDetails.tags).to.deep.equal(attributes.tags)
432 expect(videoDetails.privacy).to.deep.equal(attributes.privacy) 432 expect(videoDetails.privacy.id).to.deep.equal(attributes.privacy)
433 expect(videoDetails.privacyLabel).to.deep.equal(VIDEO_PRIVACIES[attributes.privacy]) 433 expect(videoDetails.privacy.label).to.deep.equal(VIDEO_PRIVACIES[attributes.privacy])
434 expect(videoDetails.account.name).to.equal(attributes.account.name) 434 expect(videoDetails.account.name).to.equal(attributes.account.name)
435 expect(videoDetails.account.host).to.equal(attributes.account.host) 435 expect(videoDetails.account.host).to.equal(attributes.account.host)
436 expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled) 436 expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled)
@@ -453,8 +453,8 @@ async function completeVideoCheck (
453 expect(file.magnetUri).to.have.lengthOf.above(2) 453 expect(file.magnetUri).to.have.lengthOf.above(2)
454 expect(file.torrentUrl).to.equal(`http://${attributes.account.host}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`) 454 expect(file.torrentUrl).to.equal(`http://${attributes.account.host}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`)
455 expect(file.fileUrl).to.equal(`http://${attributes.account.host}/static/webseed/${videoDetails.uuid}-${file.resolution}${extension}`) 455 expect(file.fileUrl).to.equal(`http://${attributes.account.host}/static/webseed/${videoDetails.uuid}-${file.resolution}${extension}`)
456 expect(file.resolution).to.equal(attributeFile.resolution) 456 expect(file.resolution.id).to.equal(attributeFile.resolution)
457 expect(file.resolutionLabel).to.equal(attributeFile.resolution + 'p') 457 expect(file.resolution.label).to.equal(attributeFile.resolution + 'p')
458 458
459 const minSize = attributeFile.size - ((10 * attributeFile.size) / 100) 459 const minSize = attributeFile.size - ((10 * attributeFile.size) / 100)
460 const maxSize = attributeFile.size + ((10 * attributeFile.size) / 100) 460 const maxSize = attributeFile.size + ((10 * attributeFile.size) / 100)