]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/single-pod.js
Try to fix travis build
[github/Chocobozzz/PeerTube.git] / server / tests / api / single-pod.js
index 57146900de47cb6994fe85709518c855f2bc29c7..2ac83bbf415a8369515ab98fd3a3cb28d8fd04c4 100644 (file)
@@ -83,6 +83,7 @@ describe('Test a single pod', function () {
       expect(video.isLocal).to.be.true
       expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
       expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
+      expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
 
       videosUtils.testVideoImage(server.url, 'video_short.webm', video.thumbnailPath, function (err, test) {
         if (err) throw err
@@ -117,6 +118,7 @@ describe('Test a single pod', function () {
       expect(video.isLocal).to.be.true
       expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
       expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
+      expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
 
       videosUtils.testVideoImage(server.url, 'video_short.webm', video.thumbnailPath, function (err, test) {
         if (err) throw err
@@ -143,6 +145,7 @@ describe('Test a single pod', function () {
       expect(video.isLocal).to.be.true
       expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
       expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
+      expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
 
       videosUtils.testVideoImage(server.url, 'video_short.webm', video.thumbnailPath, function (err, test) {
         if (err) throw err
@@ -170,6 +173,7 @@ describe('Test a single pod', function () {
   //     expect(video.isLocal).to.be.true
   //     expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
   //     expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
+  //     expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
 
   //     videosUtils.testVideoImage(server.url, 'video_short.webm', video.thumbnailPath, function (err, test) {
   //       if (err) throw err
@@ -196,6 +200,7 @@ describe('Test a single pod', function () {
       expect(video.isLocal).to.be.true
       expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
       expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
+      expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
 
       videosUtils.testVideoImage(server.url, 'video_short.webm', video.thumbnailPath, function (err, test) {
         if (err) throw err
@@ -510,6 +515,8 @@ describe('Test a single pod', function () {
   })
 
   it('Should have the video updated', function (done) {
+    this.timeout(60000)
+
     videosUtils.getVideo(server.url, videoId, function (err, res) {
       if (err) throw err
 
@@ -522,8 +529,22 @@ describe('Test a single pod', function () {
       expect(video.isLocal).to.be.true
       expect(video.tags).to.deep.equal([ 'tagup1', 'tagup2' ])
       expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
+      expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
 
-      done()
+      videosUtils.testVideoImage(server.url, 'video_short3.webm', video.thumbnailPath, function (err, test) {
+        if (err) throw err
+        expect(test).to.equal(true)
+
+        videoId = video.id
+
+        webtorrent.add(video.magnetUri, function (torrent) {
+          expect(torrent.files).to.exist
+          expect(torrent.files.length).to.equal(1)
+          expect(torrent.files[0].path).to.exist.and.to.not.equal('')
+
+          done()
+        })
+      })
     })
   })
 
@@ -545,6 +566,7 @@ describe('Test a single pod', function () {
         expect(video.isLocal).to.be.true
         expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'supertag' ])
         expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
+        expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
 
         done()
       })
@@ -569,6 +591,7 @@ describe('Test a single pod', function () {
         expect(video.isLocal).to.be.true
         expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'supertag' ])
         expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
+        expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
 
         done()
       })