aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-12-06 17:15:59 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-12-06 17:15:59 +0100
commitb1fa3eba70dbd7d9e5b795ad251e293c88ebeee2 (patch)
treefffcdf00d7b475c5c2de7456a7ef3c4d47c71865 /server/tests
parentce0e281d46a7b574dcccb47958743656532bd312 (diff)
downloadPeerTube-b1fa3eba70dbd7d9e5b795ad251e293c88ebeee2.tar.gz
PeerTube-b1fa3eba70dbd7d9e5b795ad251e293c88ebeee2.tar.zst
PeerTube-b1fa3eba70dbd7d9e5b795ad251e293c88ebeee2.zip
Begin video watch design
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/follows.ts2
-rw-r--r--server/tests/api/multiple-servers.ts11
-rw-r--r--server/tests/api/services.ts4
-rw-r--r--server/tests/api/single-server.ts15
-rw-r--r--server/tests/api/users.ts4
-rw-r--r--server/tests/utils/servers.ts2
6 files changed, 20 insertions, 18 deletions
diff --git a/server/tests/api/follows.ts b/server/tests/api/follows.ts
index aadae3cce..dcb4c8bd9 100644
--- a/server/tests/api/follows.ts
+++ b/server/tests/api/follows.ts
@@ -227,7 +227,7 @@ describe('Test follows', function () {
227 expect(videoDetails.nsfw).to.be.ok 227 expect(videoDetails.nsfw).to.be.ok
228 expect(videoDetails.description).to.equal('my super description') 228 expect(videoDetails.description).to.equal('my super description')
229 expect(videoDetails.serverHost).to.equal('localhost:9003') 229 expect(videoDetails.serverHost).to.equal('localhost:9003')
230 expect(videoDetails.account).to.equal('root') 230 expect(videoDetails.accountName).to.equal('root')
231 expect(videoDetails.likes).to.equal(1) 231 expect(videoDetails.likes).to.equal(1)
232 expect(videoDetails.dislikes).to.equal(1) 232 expect(videoDetails.dislikes).to.equal(1)
233 expect(videoDetails.isLocal).to.be.false 233 expect(videoDetails.isLocal).to.be.false
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/multiple-servers.ts
index c80ded862..c7f19f261 100644
--- a/server/tests/api/multiple-servers.ts
+++ b/server/tests/api/multiple-servers.ts
@@ -111,13 +111,14 @@ describe('Test multiple servers', function () {
111 expect(video.tags).to.deep.equal([ 'tag1p1', 'tag2p1' ]) 111 expect(video.tags).to.deep.equal([ 'tag1p1', 'tag2p1' ])
112 expect(dateIsValid(video.createdAt)).to.be.true 112 expect(dateIsValid(video.createdAt)).to.be.true
113 expect(dateIsValid(video.updatedAt)).to.be.true 113 expect(dateIsValid(video.updatedAt)).to.be.true
114 expect(video.account).to.equal('root') 114 expect(video.accountName).to.equal('root')
115 115
116 const res2 = await getVideo(server.url, video.uuid) 116 const res2 = await getVideo(server.url, video.uuid)
117 const videoDetails = res2.body 117 const videoDetails = res2.body
118 118
119 expect(videoDetails.channel.name).to.equal('my channel') 119 expect(videoDetails.channel.name).to.equal('my channel')
120 expect(videoDetails.channel.description).to.equal('super channel') 120 expect(videoDetails.channel.description).to.equal('super channel')
121 expect(videoDetails.account.name).to.equal('root')
121 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true 122 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true
122 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true 123 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true
123 expect(videoDetails.files).to.have.lengthOf(1) 124 expect(videoDetails.files).to.have.lengthOf(1)
@@ -201,7 +202,7 @@ describe('Test multiple servers', function () {
201 expect(video.tags).to.deep.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ]) 202 expect(video.tags).to.deep.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ])
202 expect(dateIsValid(video.createdAt)).to.be.true 203 expect(dateIsValid(video.createdAt)).to.be.true
203 expect(dateIsValid(video.updatedAt)).to.be.true 204 expect(dateIsValid(video.updatedAt)).to.be.true
204 expect(video.account).to.equal('user1') 205 expect(video.accountName).to.equal('user1')
205 206
206 if (server.url !== 'http://localhost:9002') { 207 if (server.url !== 'http://localhost:9002') {
207 expect(video.isLocal).to.be.false 208 expect(video.isLocal).to.be.false
@@ -316,7 +317,7 @@ describe('Test multiple servers', function () {
316 expect(video1.serverHost).to.equal('localhost:9003') 317 expect(video1.serverHost).to.equal('localhost:9003')
317 expect(video1.duration).to.equal(5) 318 expect(video1.duration).to.equal(5)
318 expect(video1.tags).to.deep.equal([ 'tag1p3' ]) 319 expect(video1.tags).to.deep.equal([ 'tag1p3' ])
319 expect(video1.account).to.equal('root') 320 expect(video1.accountName).to.equal('root')
320 expect(dateIsValid(video1.createdAt)).to.be.true 321 expect(dateIsValid(video1.createdAt)).to.be.true
321 expect(dateIsValid(video1.updatedAt)).to.be.true 322 expect(dateIsValid(video1.updatedAt)).to.be.true
322 323
@@ -342,7 +343,7 @@ describe('Test multiple servers', function () {
342 expect(video2.serverHost).to.equal('localhost:9003') 343 expect(video2.serverHost).to.equal('localhost:9003')
343 expect(video2.duration).to.equal(5) 344 expect(video2.duration).to.equal(5)
344 expect(video2.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ]) 345 expect(video2.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
345 expect(video2.account).to.equal('root') 346 expect(video2.accountName).to.equal('root')
346 expect(dateIsValid(video2.createdAt)).to.be.true 347 expect(dateIsValid(video2.createdAt)).to.be.true
347 expect(dateIsValid(video2.updatedAt)).to.be.true 348 expect(dateIsValid(video2.updatedAt)).to.be.true
348 349
@@ -690,7 +691,7 @@ describe('Test multiple servers', function () {
690 expect(baseVideo.licence).to.equal(video.licence) 691 expect(baseVideo.licence).to.equal(video.licence)
691 expect(baseVideo.category).to.equal(video.category) 692 expect(baseVideo.category).to.equal(video.category)
692 expect(baseVideo.nsfw).to.equal(video.nsfw) 693 expect(baseVideo.nsfw).to.equal(video.nsfw)
693 expect(baseVideo.account).to.equal(video.account) 694 expect(baseVideo.accountName).to.equal(video.accountName)
694 expect(baseVideo.tags).to.deep.equal(video.tags) 695 expect(baseVideo.tags).to.deep.equal(video.tags)
695 } 696 }
696 }) 697 })
diff --git a/server/tests/api/services.ts b/server/tests/api/services.ts
index 8d96ccc5e..4d480c305 100644
--- a/server/tests/api/services.ts
+++ b/server/tests/api/services.ts
@@ -46,7 +46,7 @@ describe('Test services', function () {
46 46
47 expect(res.body.html).to.equal(expectedHtml) 47 expect(res.body.html).to.equal(expectedHtml)
48 expect(res.body.title).to.equal(server.video.name) 48 expect(res.body.title).to.equal(server.video.name)
49 expect(res.body.author_name).to.equal(server.video.account) 49 expect(res.body.author_name).to.equal(server.video.accountName)
50 expect(res.body.width).to.equal(560) 50 expect(res.body.width).to.equal(560)
51 expect(res.body.height).to.equal(315) 51 expect(res.body.height).to.equal(315)
52 expect(res.body.thumbnail_url).to.equal(expectedThumbnailUrl) 52 expect(res.body.thumbnail_url).to.equal(expectedThumbnailUrl)
@@ -66,7 +66,7 @@ describe('Test services', function () {
66 66
67 expect(res.body.html).to.equal(expectedHtml) 67 expect(res.body.html).to.equal(expectedHtml)
68 expect(res.body.title).to.equal(server.video.name) 68 expect(res.body.title).to.equal(server.video.name)
69 expect(res.body.author_name).to.equal(server.video.account) 69 expect(res.body.author_name).to.equal(server.video.accountName)
70 expect(res.body.height).to.equal(50) 70 expect(res.body.height).to.equal(50)
71 expect(res.body.width).to.equal(50) 71 expect(res.body.width).to.equal(50)
72 expect(res.body).to.not.have.property('thumbnail_url') 72 expect(res.body).to.not.have.property('thumbnail_url')
diff --git a/server/tests/api/single-server.ts b/server/tests/api/single-server.ts
index fe192d391..d7e9ad41f 100644
--- a/server/tests/api/single-server.ts
+++ b/server/tests/api/single-server.ts
@@ -127,7 +127,7 @@ describe('Test a single server', function () {
127 expect(video.nsfw).to.be.ok 127 expect(video.nsfw).to.be.ok
128 expect(video.description).to.equal('my super description') 128 expect(video.description).to.equal('my super description')
129 expect(video.serverHost).to.equal('localhost:9001') 129 expect(video.serverHost).to.equal('localhost:9001')
130 expect(video.account).to.equal('root') 130 expect(video.accountName).to.equal('root')
131 expect(video.isLocal).to.be.true 131 expect(video.isLocal).to.be.true
132 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ]) 132 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
133 expect(dateIsValid(video.createdAt)).to.be.true 133 expect(dateIsValid(video.createdAt)).to.be.true
@@ -176,7 +176,7 @@ describe('Test a single server', function () {
176 expect(video.nsfw).to.be.ok 176 expect(video.nsfw).to.be.ok
177 expect(video.description).to.equal('my super description') 177 expect(video.description).to.equal('my super description')
178 expect(video.serverHost).to.equal('localhost:9001') 178 expect(video.serverHost).to.equal('localhost:9001')
179 expect(video.account).to.equal('root') 179 expect(video.accountName).to.equal('root')
180 expect(video.isLocal).to.be.true 180 expect(video.isLocal).to.be.true
181 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ]) 181 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
182 expect(dateIsValid(video.createdAt)).to.be.true 182 expect(dateIsValid(video.createdAt)).to.be.true
@@ -243,7 +243,7 @@ describe('Test a single server', function () {
243 expect(video.nsfw).to.be.ok 243 expect(video.nsfw).to.be.ok
244 expect(video.description).to.equal('my super description') 244 expect(video.description).to.equal('my super description')
245 expect(video.serverHost).to.equal('localhost:9001') 245 expect(video.serverHost).to.equal('localhost:9001')
246 expect(video.account).to.equal('root') 246 expect(video.accountName).to.equal('root')
247 expect(video.isLocal).to.be.true 247 expect(video.isLocal).to.be.true
248 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ]) 248 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
249 expect(dateIsValid(video.createdAt)).to.be.true 249 expect(dateIsValid(video.createdAt)).to.be.true
@@ -298,7 +298,7 @@ describe('Test a single server', function () {
298 // expect(video.nsfw).to.be.ok 298 // expect(video.nsfw).to.be.ok
299 // expect(video.description).to.equal('my super description') 299 // expect(video.description).to.equal('my super description')
300 // expect(video.serverHost).to.equal('localhost:9001') 300 // expect(video.serverHost).to.equal('localhost:9001')
301 // expect(video.account).to.equal('root') 301 // expect(video.accountName).to.equal('root')
302 // expect(video.isLocal).to.be.true 302 // expect(video.isLocal).to.be.true
303 // expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ]) 303 // expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
304 // expect(dateIsValid(video.createdAt)).to.be.true 304 // expect(dateIsValid(video.createdAt)).to.be.true
@@ -563,7 +563,8 @@ describe('Test a single server', function () {
563 expect(video.nsfw).to.be.ok 563 expect(video.nsfw).to.be.ok
564 expect(video.description).to.equal('my super description updated') 564 expect(video.description).to.equal('my super description updated')
565 expect(video.serverHost).to.equal('localhost:9001') 565 expect(video.serverHost).to.equal('localhost:9001')
566 expect(video.account).to.equal('root') 566 expect(video.accountName).to.equal('root')
567 expect(video.account.name).to.equal('root')
567 expect(video.isLocal).to.be.true 568 expect(video.isLocal).to.be.true
568 expect(video.tags).to.deep.equal([ 'tagup1', 'tagup2' ]) 569 expect(video.tags).to.deep.equal([ 'tagup1', 'tagup2' ])
569 expect(dateIsValid(video.createdAt)).to.be.true 570 expect(dateIsValid(video.createdAt)).to.be.true
@@ -612,7 +613,7 @@ describe('Test a single server', function () {
612 expect(video.nsfw).to.be.ok 613 expect(video.nsfw).to.be.ok
613 expect(video.description).to.equal('my super description updated') 614 expect(video.description).to.equal('my super description updated')
614 expect(video.serverHost).to.equal('localhost:9001') 615 expect(video.serverHost).to.equal('localhost:9001')
615 expect(video.account).to.equal('root') 616 expect(video.accountName).to.equal('root')
616 expect(video.isLocal).to.be.true 617 expect(video.isLocal).to.be.true
617 expect(video.tags).to.deep.equal([ 'supertag', 'tag1', 'tag2' ]) 618 expect(video.tags).to.deep.equal([ 'supertag', 'tag1', 'tag2' ])
618 expect(dateIsValid(video.createdAt)).to.be.true 619 expect(dateIsValid(video.createdAt)).to.be.true
@@ -652,7 +653,7 @@ describe('Test a single server', function () {
652 expect(video.nsfw).to.be.ok 653 expect(video.nsfw).to.be.ok
653 expect(video.description).to.equal('hello everybody') 654 expect(video.description).to.equal('hello everybody')
654 expect(video.serverHost).to.equal('localhost:9001') 655 expect(video.serverHost).to.equal('localhost:9001')
655 expect(video.account).to.equal('root') 656 expect(video.accountName).to.equal('root')
656 expect(video.isLocal).to.be.true 657 expect(video.isLocal).to.be.true
657 expect(video.tags).to.deep.equal([ 'supertag', 'tag1', 'tag2' ]) 658 expect(video.tags).to.deep.equal([ 'supertag', 'tag1', 'tag2' ])
658 expect(dateIsValid(video.createdAt)).to.be.true 659 expect(dateIsValid(video.createdAt)).to.be.true
diff --git a/server/tests/api/users.ts b/server/tests/api/users.ts
index 33646e84f..5066e73fc 100644
--- a/server/tests/api/users.ts
+++ b/server/tests/api/users.ts
@@ -117,7 +117,7 @@ describe('Test users', function () {
117 const res = await getVideosList(server.url) 117 const res = await getVideosList(server.url)
118 const video = res.body.data[ 0 ] 118 const video = res.body.data[ 0 ]
119 119
120 expect(video.account) 120 expect(video.accountName)
121 .to 121 .to
122 .equal('root') 122 .equal('root')
123 videoId = video.id 123 videoId = video.id
@@ -487,7 +487,7 @@ describe('Test users', function () {
487 .equal(1) 487 .equal(1)
488 488
489 const video = res.body.data[ 0 ] 489 const video = res.body.data[ 0 ]
490 expect(video.account) 490 expect(video.accountName)
491 .to 491 .to
492 .equal('root') 492 .equal('root')
493 }) 493 })
diff --git a/server/tests/utils/servers.ts b/server/tests/utils/servers.ts
index faa2f19ff..8340fbc18 100644
--- a/server/tests/utils/servers.ts
+++ b/server/tests/utils/servers.ts
@@ -24,7 +24,7 @@ interface ServerInfo {
24 id: number 24 id: number
25 uuid: string 25 uuid: string
26 name: string 26 name: string
27 account: string 27 accountName: string
28 } 28 }
29 29
30 remoteVideo?: { 30 remoteVideo?: {