]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/single-server.ts
Fix optimize old videos script
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / single-server.ts
index 12181ad671033992836844b4c9c1580e3f6dbc98..089c3df25990b07f2a831f896b2fb816b1489dff 100644 (file)
@@ -56,7 +56,8 @@ describe('Test a single server', function () {
     privacy: VideoPrivacy.PUBLIC,
     commentsEnabled: true,
     channel: {
-      name: 'Main root channel',
+      displayName: 'Main root channel',
+      name: 'root_channel',
       description: '',
       isLocal: true
     },
@@ -87,7 +88,8 @@ describe('Test a single server', function () {
     duration: 5,
     commentsEnabled: false,
     channel: {
-      name: 'Main root channel',
+      name: 'root_channel',
+      displayName: 'Main root channel',
       description: '',
       isLocal: true
     },
@@ -116,7 +118,7 @@ describe('Test a single server', function () {
     const categories = res.body
     expect(Object.keys(categories)).to.have.length.above(10)
 
-    expect(categories[11]).to.equal('News')
+    expect(categories[11]).to.equal('News & Politics')
   })
 
   it('Should list video licences', async function () {
@@ -194,7 +196,7 @@ describe('Test a single server', function () {
   })
 
   it('Should have the views updated', async function () {
-    this.timeout(10000)
+    this.timeout(20000)
 
     await viewVideo(server.url, videoId)
     await viewVideo(server.url, videoId)
@@ -210,6 +212,9 @@ describe('Test a single server', function () {
     await viewVideo(server.url, videoId)
     await viewVideo(server.url, videoId)
 
+    // Wait the repeatable job
+    await wait(8000)
+
     const res = await getVideo(server.url, videoId)
 
     const video = res.body
@@ -334,6 +339,14 @@ describe('Test a single server', function () {
     videoId = videos[3].uuid
   })
 
+  it('Should list and sort by trending in descending order', async function () {
+    const res = await getVideosListPagination(server.url, 0, 2, '-trending')
+
+    const videos = res.body.data
+    expect(res.body.total).to.equal(6)
+    expect(videos.length).to.equal(2)
+  })
+
   it('Should update a video', async function () {
     const attributes = {
       name: 'my super video updated',