aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/real-world/real-world.ts2
-rw-r--r--server/tests/utils/videos/videos.ts20
2 files changed, 11 insertions, 11 deletions
diff --git a/server/tests/real-world/real-world.ts b/server/tests/real-world/real-world.ts
index f10ca856d..ae02ef64d 100644
--- a/server/tests/real-world/real-world.ts
+++ b/server/tests/real-world/real-world.ts
@@ -327,7 +327,7 @@ function areDifferences (videos1: Video[], videos2: Video[]) {
327 return `Video ${video1.uuid} has missing video file ${videoFile1.magnetUri}.` 327 return `Video ${video1.uuid} has missing video file ${videoFile1.magnetUri}.`
328 } 328 }
329 329
330 if (videoFile1.size !== videoFile2.size || videoFile1.resolutionLabel !== videoFile2.resolutionLabel) { 330 if (videoFile1.size !== videoFile2.size || videoFile1.resolution.label !== videoFile2.resolution.label) {
331 return `Video ${video1.uuid} has different video file ${videoFile1.magnetUri}.` 331 return `Video ${video1.uuid} has different video file ${videoFile1.magnetUri}.`
332 } 332 }
333 }) 333 })
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)