aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-14 10:20:05 +0100
committerChocobozzz <me@florianbigard.com>2017-12-14 10:20:05 +0100
commit6f045b57915d0eac8e590c503b362d2df5e16b85 (patch)
treeb26a305c1ab53fe1f8d3856216c8493064790bc7 /server
parentd48ff09d27d234425c3e9f091ae9072d8e6d8b7a (diff)
downloadPeerTube-6f045b57915d0eac8e590c503b362d2df5e16b85.tar.gz
PeerTube-6f045b57915d0eac8e590c503b362d2df5e16b85.tar.zst
PeerTube-6f045b57915d0eac8e590c503b362d2df5e16b85.zip
Fix tests
Diffstat (limited to 'server')
-rw-r--r--server/tests/api/multiple-servers.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/multiple-servers.ts
index 2f17f017a..6fe1fb651 100644
--- a/server/tests/api/multiple-servers.ts
+++ b/server/tests/api/multiple-servers.ts
@@ -110,7 +110,6 @@ describe('Test multiple servers', function () {
110 expect(video.description).to.equal('my super description for server 1') 110 expect(video.description).to.equal('my super description for server 1')
111 expect(video.serverHost).to.equal('localhost:9001') 111 expect(video.serverHost).to.equal('localhost:9001')
112 expect(video.duration).to.equal(10) 112 expect(video.duration).to.equal(10)
113 expect(video.tags).to.deep.equal([ 'tag1p1', 'tag2p1' ])
114 expect(dateIsValid(video.createdAt)).to.be.true 113 expect(dateIsValid(video.createdAt)).to.be.true
115 expect(dateIsValid(video.updatedAt)).to.be.true 114 expect(dateIsValid(video.updatedAt)).to.be.true
116 expect(video.accountName).to.equal('root') 115 expect(video.accountName).to.equal('root')
@@ -124,6 +123,7 @@ describe('Test multiple servers', function () {
124 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true 123 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true
125 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true 124 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true
126 expect(videoDetails.files).to.have.lengthOf(1) 125 expect(videoDetails.files).to.have.lengthOf(1)
126 expect(videoDetails.tags).to.deep.equal([ 'tag1p1', 'tag2p1' ])
127 127
128 const file = videoDetails.files[0] 128 const file = videoDetails.files[0]
129 const magnetUri = file.magnetUri 129 const magnetUri = file.magnetUri
@@ -201,7 +201,6 @@ describe('Test multiple servers', function () {
201 expect(video.description).to.equal('my super description for server 2') 201 expect(video.description).to.equal('my super description for server 2')
202 expect(video.serverHost).to.equal('localhost:9002') 202 expect(video.serverHost).to.equal('localhost:9002')
203 expect(video.duration).to.equal(5) 203 expect(video.duration).to.equal(5)
204 expect(video.tags).to.deep.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ])
205 expect(dateIsValid(video.createdAt)).to.be.true 204 expect(dateIsValid(video.createdAt)).to.be.true
206 expect(dateIsValid(video.updatedAt)).to.be.true 205 expect(dateIsValid(video.updatedAt)).to.be.true
207 expect(video.accountName).to.equal('user1') 206 expect(video.accountName).to.equal('user1')
@@ -218,6 +217,7 @@ describe('Test multiple servers', function () {
218 expect(videoDetails.channel.name).to.equal('Default user1 channel') 217 expect(videoDetails.channel.name).to.equal('Default user1 channel')
219 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true 218 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true
220 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true 219 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true
220 expect(videoDetails.tags).to.deep.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ])
221 221
222 expect(videoDetails.files).to.have.lengthOf(4) 222 expect(videoDetails.files).to.have.lengthOf(4)
223 223
@@ -318,7 +318,6 @@ describe('Test multiple servers', function () {
318 expect(video1.description).to.equal('my super description for server 3') 318 expect(video1.description).to.equal('my super description for server 3')
319 expect(video1.serverHost).to.equal('localhost:9003') 319 expect(video1.serverHost).to.equal('localhost:9003')
320 expect(video1.duration).to.equal(5) 320 expect(video1.duration).to.equal(5)
321 expect(video1.tags).to.deep.equal([ 'tag1p3' ])
322 expect(video1.accountName).to.equal('root') 321 expect(video1.accountName).to.equal('root')
323 expect(dateIsValid(video1.createdAt)).to.be.true 322 expect(dateIsValid(video1.createdAt)).to.be.true
324 expect(dateIsValid(video1.updatedAt)).to.be.true 323 expect(dateIsValid(video1.updatedAt)).to.be.true
@@ -326,6 +325,7 @@ describe('Test multiple servers', function () {
326 const res2 = await getVideo(server.url, video1.id) 325 const res2 = await getVideo(server.url, video1.id)
327 const video1Details = res2.body 326 const video1Details = res2.body
328 expect(video1Details.files).to.have.lengthOf(1) 327 expect(video1Details.files).to.have.lengthOf(1)
328 expect(video1Details.tags).to.deep.equal([ 'tag1p3' ])
329 329
330 const file1 = video1Details.files[0] 330 const file1 = video1Details.files[0]
331 expect(file1.magnetUri).to.have.lengthOf.above(2) 331 expect(file1.magnetUri).to.have.lengthOf.above(2)
@@ -344,13 +344,13 @@ describe('Test multiple servers', function () {
344 expect(video2.description).to.equal('my super description for server 3-2') 344 expect(video2.description).to.equal('my super description for server 3-2')
345 expect(video2.serverHost).to.equal('localhost:9003') 345 expect(video2.serverHost).to.equal('localhost:9003')
346 expect(video2.duration).to.equal(5) 346 expect(video2.duration).to.equal(5)
347 expect(video2.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
348 expect(video2.accountName).to.equal('root') 347 expect(video2.accountName).to.equal('root')
349 expect(dateIsValid(video2.createdAt)).to.be.true 348 expect(dateIsValid(video2.createdAt)).to.be.true
350 expect(dateIsValid(video2.updatedAt)).to.be.true 349 expect(dateIsValid(video2.updatedAt)).to.be.true
351 350
352 const res3 = await getVideo(server.url, video2.id) 351 const res3 = await getVideo(server.url, video2.id)
353 const video2Details = res3.body 352 const video2Details = res3.body
353 expect(video2Details.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
354 354
355 expect(video2Details.files).to.have.lengthOf(1) 355 expect(video2Details.files).to.have.lengthOf(1)
356 356
@@ -624,13 +624,13 @@ describe('Test multiple servers', function () {
624 expect(videoUpdated.languageLabel).to.equal('French') 624 expect(videoUpdated.languageLabel).to.equal('French')
625 expect(videoUpdated.nsfw).to.be.ok 625 expect(videoUpdated.nsfw).to.be.ok
626 expect(videoUpdated.description).to.equal('my super description updated') 626 expect(videoUpdated.description).to.equal('my super description updated')
627 expect(videoUpdated.tags).to.deep.equal([ 'tag_up_1', 'tag_up_2' ])
628 expect(dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true 627 expect(dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true
629 628
630 const res2 = await getVideo(server.url, videoUpdated.uuid) 629 const res2 = await getVideo(server.url, videoUpdated.uuid)
631 const videoUpdatedDetails = res2.body 630 const videoUpdatedDetails = res2.body
631 expect(videoUpdatedDetails.tags).to.deep.equal([ 'tag_up_1', 'tag_up_2' ])
632 632
633 const file = videoUpdatedDetails .files[0] 633 const file = videoUpdatedDetails.files[0]
634 expect(file.magnetUri).to.have.lengthOf.above(2) 634 expect(file.magnetUri).to.have.lengthOf.above(2)
635 expect(file.resolution).to.equal(720) 635 expect(file.resolution).to.equal(720)
636 expect(file.resolutionLabel).to.equal('720p') 636 expect(file.resolutionLabel).to.equal('720p')
@@ -746,7 +746,6 @@ describe('Test multiple servers', function () {
746 expect(video.description).to.equal(null) 746 expect(video.description).to.equal(null)
747 expect(video.serverHost).to.equal('localhost:9002') 747 expect(video.serverHost).to.equal('localhost:9002')
748 expect(video.accountName).to.equal('root') 748 expect(video.accountName).to.equal('root')
749 expect(video.tags).to.deep.equal([ ])
750 expect(dateIsValid(video.createdAt)).to.be.true 749 expect(dateIsValid(video.createdAt)).to.be.true
751 expect(dateIsValid(video.updatedAt)).to.be.true 750 expect(dateIsValid(video.updatedAt)).to.be.true
752 } 751 }