diff options
Diffstat (limited to 'server/tests/api/single-pod.js')
-rw-r--r-- | server/tests/api/single-pod.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/server/tests/api/single-pod.js b/server/tests/api/single-pod.js index e08da0517..0dac9a183 100644 --- a/server/tests/api/single-pod.js +++ b/server/tests/api/single-pod.js | |||
@@ -19,6 +19,7 @@ const videosUtils = require('../utils/videos') | |||
19 | describe('Test a single pod', function () { | 19 | describe('Test a single pod', function () { |
20 | let server = null | 20 | let server = null |
21 | let videoId = -1 | 21 | let videoId = -1 |
22 | let videoUUID = '' | ||
22 | let videosListBase = null | 23 | let videosListBase = null |
23 | 24 | ||
24 | before(function (done) { | 25 | before(function (done) { |
@@ -140,6 +141,7 @@ describe('Test a single pod', function () { | |||
140 | expect(test).to.equal(true) | 141 | expect(test).to.equal(true) |
141 | 142 | ||
142 | videoId = video.id | 143 | videoId = video.id |
144 | videoUUID = video.uuid | ||
143 | 145 | ||
144 | webtorrent.add(video.magnetUri, function (torrent) { | 146 | webtorrent.add(video.magnetUri, function (torrent) { |
145 | expect(torrent.files).to.exist | 147 | expect(torrent.files).to.exist |
@@ -181,18 +183,33 @@ describe('Test a single pod', function () { | |||
181 | if (err) throw err | 183 | if (err) throw err |
182 | expect(test).to.equal(true) | 184 | expect(test).to.equal(true) |
183 | 185 | ||
184 | // Wait the async views increment | 186 | // Wait the async views increment |
185 | setTimeout(done, 500) | 187 | setTimeout(done, 500) |
186 | }) | 188 | }) |
187 | }) | 189 | }) |
188 | }) | 190 | }) |
189 | 191 | ||
192 | it('Should get the video by UUID', function (done) { | ||
193 | // Yes, this could be long | ||
194 | this.timeout(60000) | ||
195 | |||
196 | videosUtils.getVideo(server.url, videoUUID, function (err, res) { | ||
197 | if (err) throw err | ||
198 | |||
199 | const video = res.body | ||
200 | expect(video.name).to.equal('my super name') | ||
201 | |||
202 | // Wait the async views increment | ||
203 | setTimeout(done, 500) | ||
204 | }) | ||
205 | }) | ||
206 | |||
190 | it('Should have the views updated', function (done) { | 207 | it('Should have the views updated', function (done) { |
191 | videosUtils.getVideo(server.url, videoId, function (err, res) { | 208 | videosUtils.getVideo(server.url, videoId, function (err, res) { |
192 | if (err) throw err | 209 | if (err) throw err |
193 | 210 | ||
194 | const video = res.body | 211 | const video = res.body |
195 | expect(video.views).to.equal(1) | 212 | expect(video.views).to.equal(2) |
196 | 213 | ||
197 | done() | 214 | done() |
198 | }) | 215 | }) |