]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/stats.ts
Add redundancy stats
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / stats.ts
index e75089a147aafbb3132a869c25aeb4034efd47c6..d8a3268bb969d933cd253a580734c8f1f0b05257 100644 (file)
@@ -21,7 +21,7 @@ import { waitJobs } from '../../utils/server/jobs'
 
 const expect = chai.expect
 
-describe('Test stats', function () {
+describe('Test stats (excluding redundancy)', function () {
   let servers: ServerInfo[] = []
 
   before(async function () {
@@ -46,6 +46,9 @@ describe('Test stats', function () {
 
     await viewVideo(servers[0].url, videoUUID)
 
+    // Wait the video views repeatable job
+    await wait(8000)
+
     await follow(servers[2].url, [ servers[0].url ], servers[2].accessToken)
     await waitJobs(servers)
   })
@@ -62,6 +65,7 @@ describe('Test stats', function () {
     expect(data.totalVideos).to.equal(1)
     expect(data.totalInstanceFollowers).to.equal(2)
     expect(data.totalInstanceFollowing).to.equal(1)
+    expect(data.videosRedundancy).to.have.lengthOf(0)
   })
 
   it('Should have the correct stats on instance 2', async function () {
@@ -76,6 +80,7 @@ describe('Test stats', function () {
     expect(data.totalVideos).to.equal(1)
     expect(data.totalInstanceFollowers).to.equal(1)
     expect(data.totalInstanceFollowing).to.equal(1)
+    expect(data.videosRedundancy).to.have.lengthOf(0)
   })
 
   it('Should have the correct stats on instance 3', async function () {
@@ -90,6 +95,7 @@ describe('Test stats', function () {
     expect(data.totalVideos).to.equal(1)
     expect(data.totalInstanceFollowing).to.equal(1)
     expect(data.totalInstanceFollowers).to.equal(0)
+    expect(data.videosRedundancy).to.have.lengthOf(0)
   })
 
   after(async function () {