]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/single-server.ts
Merge branch 'release/v1.2.0'
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / single-server.ts
index a757ad9da809fb19b913072b05e5941b0c9633d3..069dec67c8680b3bf33085492d5fad6438a9c407 100644 (file)
@@ -28,7 +28,7 @@ import {
   uploadVideo,
   viewVideo,
   wait
-} from '../../utils'
+} from '../../../../shared/utils'
 
 const expect = chai.expect
 
@@ -118,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 () {
@@ -196,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)
@@ -212,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
@@ -336,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',