]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/multiple-servers.ts
Upgrade server dep'
[github/Chocobozzz/PeerTube.git] / server / tests / api / multiple-servers.ts
index b6a57ab6d46269979ffd42db24ef3534476ea616..052b0231f2c986cedf869c726440a3f3b1ff29ab 100644 (file)
@@ -69,8 +69,7 @@ describe('Test multiple servers', function () {
 
   describe('Should upload the video and propagate on each server', function () {
     it('Should upload the video on server 1 and propagate on each server', async function () {
-      // Server 1 has video transcoding activated
-      this.timeout(15000)
+      this.timeout(25000)
 
       const videoAttributes = {
         name: 'my super name for server 1',
@@ -85,7 +84,7 @@ describe('Test multiple servers', function () {
       }
       await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes)
 
-      await wait(5000)
+      await wait(10000)
 
       // All servers should have this video
       for (const server of servers) {
@@ -175,7 +174,7 @@ describe('Test multiple servers', function () {
       await uploadVideo(servers[1].url, userAccessToken, videoAttributes)
 
       // Transcoding
-      await wait(10000)
+      await wait(30000)
 
       // All servers should have this video
       for (const server of servers) {
@@ -316,7 +315,7 @@ describe('Test multiple servers', function () {
         expect(video1.serverHost).to.equal('localhost:9003')
         expect(video1.duration).to.equal(5)
         expect(video1.tags).to.deep.equal([ 'tag1p3' ])
-        expect(video1.author).to.equal('root')
+        expect(video1.account).to.equal('root')
         expect(dateIsValid(video1.createdAt)).to.be.true
         expect(dateIsValid(video1.updatedAt)).to.be.true
 
@@ -342,7 +341,7 @@ describe('Test multiple servers', function () {
         expect(video2.serverHost).to.equal('localhost:9003')
         expect(video2.duration).to.equal(5)
         expect(video2.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
-        expect(video2.author).to.equal('root')
+        expect(video2.account).to.equal('root')
         expect(dateIsValid(video2.createdAt)).to.be.true
         expect(dateIsValid(video2.updatedAt)).to.be.true
 
@@ -537,7 +536,7 @@ describe('Test multiple servers', function () {
         // Initialize base videos for future comparisons
         if (baseVideos === null) {
           baseVideos = videos
-          return
+          continue
         }
 
         for (const baseVideo of baseVideos) {
@@ -572,14 +571,14 @@ describe('Test multiple servers', function () {
         // Initialize base videos for future comparisons
         if (baseVideos === null) {
           baseVideos = videos
-          return
+          continue
         }
 
-        baseVideos.forEach(baseVideo => {
+        for (const baseVideo of baseVideos) {
           const sameVideo = videos.find(video => video.name === baseVideo.name)
           expect(baseVideo.likes).to.equal(sameVideo.likes)
           expect(baseVideo.dislikes).to.equal(sameVideo.dislikes)
-        })
+        }
       }
     })
   })
@@ -680,7 +679,7 @@ describe('Test multiple servers', function () {
 
         if (baseVideo === null) {
           baseVideo = video
-          return
+          continue
         }
 
         expect(baseVideo.name).to.equal(video.name)
@@ -690,7 +689,7 @@ describe('Test multiple servers', function () {
         expect(baseVideo.licence).to.equal(video.licence)
         expect(baseVideo.category).to.equal(video.category)
         expect(baseVideo.nsfw).to.equal(video.nsfw)
-        expect(baseVideo.author).to.equal(video.account)
+        expect(baseVideo.account).to.equal(video.account)
         expect(baseVideo.tags).to.deep.equal(video.tags)
       }
     })