]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/stats.ts
Fix total videos stats
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / stats.ts
index c207bb5f00196e649e163458c62766e06d2cbab9..fe956413c088e177db42bb484166981db8d40d71 100644 (file)
@@ -9,7 +9,7 @@ import {
   doubleFollow,
   flushAndRunMultipleServers,
   follow,
-  ServerInfo,
+  ServerInfo, unfollow,
   uploadVideo,
   viewVideo,
   wait
@@ -95,6 +95,16 @@ describe('Test stats (excluding redundancy)', function () {
     expect(data.totalInstanceFollowers).to.equal(0)
   })
 
+  it('Should have the correct total videos stats after an unfollow', async function () {
+    await unfollow(servers[2].url, servers[2].accessToken, servers[0])
+    await waitJobs(servers)
+
+    const res = await getStats(servers[2].url)
+    const data: ServerStats = res.body
+
+    expect(data.totalVideos).to.equal(0)
+  })
+
   after(async function () {
     await cleanupTests(servers)
   })