diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-30 11:11:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-30 11:12:09 +0200 |
commit | 04bf312cdac0fe601864c19bdbd4f24c73ae08ae (patch) | |
tree | 2265582695bb2c6d6b4f2994414490c72bab782c /server/tests/cli | |
parent | 0c948c1659c0a6010f2bf58c402b1c9af192aa5e (diff) | |
download | PeerTube-04bf312cdac0fe601864c19bdbd4f24c73ae08ae.tar.gz PeerTube-04bf312cdac0fe601864c19bdbd4f24c73ae08ae.tar.zst PeerTube-04bf312cdac0fe601864c19bdbd4f24c73ae08ae.zip |
Improve create transcoding jobs tests
Diffstat (limited to 'server/tests/cli')
-rw-r--r-- | server/tests/cli/create-transcoding-job.ts | 15 |
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 | } |