]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/single-pod.js
Use global uuid instead of remoteId for videos
[github/Chocobozzz/PeerTube.git] / server / tests / api / single-pod.js
index e08da05172b0fe1a018210444a8bc7591920bd3c..0dac9a1833a036f471e3f0ef78fc97fa9727c6bf 100644 (file)
@@ -19,6 +19,7 @@ const videosUtils = require('../utils/videos')
 describe('Test a single pod', function () {
   let server = null
   let videoId = -1
+  let videoUUID = ''
   let videosListBase = null
 
   before(function (done) {
@@ -140,6 +141,7 @@ describe('Test a single pod', function () {
         expect(test).to.equal(true)
 
         videoId = video.id
+        videoUUID = video.uuid
 
         webtorrent.add(video.magnetUri, function (torrent) {
           expect(torrent.files).to.exist
@@ -181,18 +183,33 @@ describe('Test a single pod', function () {
         if (err) throw err
         expect(test).to.equal(true)
 
-       // Wait the async views increment
+        // Wait the async views increment
         setTimeout(done, 500)
       })
     })
   })
 
+  it('Should get the video by UUID', function (done) {
+    // Yes, this could be long
+    this.timeout(60000)
+
+    videosUtils.getVideo(server.url, videoUUID, function (err, res) {
+      if (err) throw err
+
+      const video = res.body
+      expect(video.name).to.equal('my super name')
+
+      // Wait the async views increment
+      setTimeout(done, 500)
+    })
+  })
+
   it('Should have the views updated', function (done) {
     videosUtils.getVideo(server.url, videoId, function (err, res) {
       if (err) throw err
 
       const video = res.body
-      expect(video.views).to.equal(1)
+      expect(video.views).to.equal(2)
 
       done()
     })