aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-31 17:18:13 +0200
committerChocobozzz <me@florianbigard.com>2018-08-31 17:22:01 +0200
commit9a629c6efbe39dfac290347670ca41b0d7100f41 (patch)
tree22c491983071aebe928fe73a2c51a8347fc78b8a /server/tests/api/videos
parent4ccb6c083025005a495e8ed40ea352c541f66951 (diff)
downloadPeerTube-9a629c6efbe39dfac290347670ca41b0d7100f41.tar.gz
PeerTube-9a629c6efbe39dfac290347670ca41b0d7100f41.tar.zst
PeerTube-9a629c6efbe39dfac290347670ca41b0d7100f41.zip
Trending by interval
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/videos-overview.ts20
1 files changed, 12 insertions, 8 deletions
diff --git a/server/tests/api/videos/videos-overview.ts b/server/tests/api/videos/videos-overview.ts
index 1514d1bda..7d1f29c92 100644
--- a/server/tests/api/videos/videos-overview.ts
+++ b/server/tests/api/videos/videos-overview.ts
@@ -30,8 +30,10 @@ describe('Test a videos overview', function () {
30 expect(overview.channels).to.have.lengthOf(0) 30 expect(overview.channels).to.have.lengthOf(0)
31 }) 31 })
32 32
33 it('Should upload 3 videos in a specific category, tag and channel but not include them in overview', async function () { 33 it('Should upload 5 videos in a specific category, tag and channel but not include them in overview', async function () {
34 for (let i = 0; i < 3; i++) { 34 this.timeout(15000)
35
36 for (let i = 0; i < 5; i++) {
35 await uploadVideo(server.url, server.accessToken, { 37 await uploadVideo(server.url, server.accessToken, {
36 name: 'video ' + i, 38 name: 'video ' + i,
37 category: 3, 39 category: 3,
@@ -49,7 +51,7 @@ describe('Test a videos overview', function () {
49 51
50 it('Should upload another video and include all videos in the overview', async function () { 52 it('Should upload another video and include all videos in the overview', async function () {
51 await uploadVideo(server.url, server.accessToken, { 53 await uploadVideo(server.url, server.accessToken, {
52 name: 'video 3', 54 name: 'video 5',
53 category: 3, 55 category: 3,
54 tags: [ 'coucou1', 'coucou2' ] 56 tags: [ 'coucou1', 'coucou2' ]
55 }) 57 })
@@ -70,11 +72,13 @@ describe('Test a videos overview', function () {
70 for (const attr of [ 'tags', 'categories', 'channels' ]) { 72 for (const attr of [ 'tags', 'categories', 'channels' ]) {
71 const obj = overview[attr][0] 73 const obj = overview[attr][0]
72 74
73 expect(obj.videos).to.have.lengthOf(4) 75 expect(obj.videos).to.have.lengthOf(6)
74 expect(obj.videos[0].name).to.equal('video 3') 76 expect(obj.videos[0].name).to.equal('video 5')
75 expect(obj.videos[1].name).to.equal('video 2') 77 expect(obj.videos[1].name).to.equal('video 4')
76 expect(obj.videos[2].name).to.equal('video 1') 78 expect(obj.videos[2].name).to.equal('video 3')
77 expect(obj.videos[3].name).to.equal('video 0') 79 expect(obj.videos[3].name).to.equal('video 2')
80 expect(obj.videos[4].name).to.equal('video 1')
81 expect(obj.videos[5].name).to.equal('video 0')
78 } 82 }
79 83
80 expect(overview.tags.find(t => t.tag === 'coucou1')).to.not.be.undefined 84 expect(overview.tags.find(t => t.tag === 'coucou1')).to.not.be.undefined