diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-05-17 21:03:00 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-05-17 21:03:00 +0200 |
commit | a877d5acc5c52b8667c65f725bbca9a52e40ec48 (patch) | |
tree | 20b5dd56f71c7572360807f894e85e0ab729629f /server/tests/api/singlePod.js | |
parent | 479f229198bdfcfd3a63d02babdddaa8b2209ccb (diff) | |
download | PeerTube-a877d5acc5c52b8667c65f725bbca9a52e40ec48.tar.gz PeerTube-a877d5acc5c52b8667c65f725bbca9a52e40ec48.tar.zst PeerTube-a877d5acc5c52b8667c65f725bbca9a52e40ec48.zip |
Add ability to sort videos list
Diffstat (limited to 'server/tests/api/singlePod.js')
-rw-r--r-- | server/tests/api/singlePod.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/server/tests/api/singlePod.js b/server/tests/api/singlePod.js index 72002b631..1a53ada3a 100644 --- a/server/tests/api/singlePod.js +++ b/server/tests/api/singlePod.js | |||
@@ -314,6 +314,39 @@ describe('Test a single pod', function () { | |||
314 | }) | 314 | }) |
315 | }) | 315 | }) |
316 | 316 | ||
317 | it('Should list and sort by name in descending order', function (done) { | ||
318 | utils.getVideosListSort(server.url, '-name', function (err, res) { | ||
319 | if (err) throw err | ||
320 | |||
321 | const videos = res.body | ||
322 | expect(videos.length).to.equal(6) | ||
323 | expect(videos[5].name === 'video_short.mp4 name') | ||
324 | expect(videos[4].name === 'video_short.ogv name') | ||
325 | expect(videos[3].name === 'video_short.webm name') | ||
326 | expect(videos[2].name === 'video_short1.webm name') | ||
327 | expect(videos[1].name === 'video_short2.webm name') | ||
328 | expect(videos[0].name === 'video_short3.webm name') | ||
329 | |||
330 | done() | ||
331 | }) | ||
332 | }) | ||
333 | |||
334 | it('Should search and sort by name in ascending order', function (done) { | ||
335 | utils.searchVideoWithSort(server.url, 'webm', 'name', function (err, res) { | ||
336 | if (err) throw err | ||
337 | |||
338 | const videos = res.body | ||
339 | expect(videos.length).to.equal(4) | ||
340 | |||
341 | expect(videos[0].name === 'video_short.webm name') | ||
342 | expect(videos[1].name === 'video_short1.webm name') | ||
343 | expect(videos[2].name === 'video_short2.webm name') | ||
344 | expect(videos[3].name === 'video_short3.webm name') | ||
345 | |||
346 | done() | ||
347 | }) | ||
348 | }) | ||
349 | |||
317 | after(function (done) { | 350 | after(function (done) { |
318 | process.kill(-server.app.pid) | 351 | process.kill(-server.app.pid) |
319 | process.kill(-webtorrent.app.pid) | 352 | process.kill(-webtorrent.app.pid) |