aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/cli')
-rw-r--r--server/tests/cli/create-transcoding-job.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts
index c2214d285..557dd8af9 100644
--- a/server/tests/cli/create-transcoding-job.ts
+++ b/server/tests/cli/create-transcoding-job.ts
@@ -72,12 +72,27 @@ describe('Test create transcoding jobs', function () {
72 const videos = res.body.data 72 const videos = res.body.data
73 expect(videos).to.have.lengthOf(2) 73 expect(videos).to.have.lengthOf(2)
74 74
75 let infoHashes: { [ id: number ]: string }
76
75 for (const video of videos) { 77 for (const video of videos) {
76 const res2 = await getVideo(server.url, video.uuid) 78 const res2 = await getVideo(server.url, video.uuid)
77 const videoDetail: VideoDetails = res2.body 79 const videoDetail: VideoDetails = res2.body
78 80
79 if (video.uuid === video2UUID) { 81 if (video.uuid === video2UUID) {
80 expect(videoDetail.files).to.have.lengthOf(4) 82 expect(videoDetail.files).to.have.lengthOf(4)
83
84 if (!infoHashes) {
85 infoHashes = {}
86
87 for (const file of videoDetail.files) {
88 infoHashes[file.resolution.id.toString()] = file.magnetUri
89 }
90 } else {
91 for (const resolution of Object.keys(infoHashes)) {
92 const file = videoDetail.files.find(f => f.resolution.id.toString() === resolution)
93 expect(file.magnetUri).to.equal(infoHashes[resolution])
94 }
95 }
81 } else { 96 } else {
82 expect(videoDetail.files).to.have.lengthOf(1) 97 expect(videoDetail.files).to.have.lengthOf(1)
83 } 98 }