From baab47ca81742deae15acd671e8c332a4e1d6eb7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 13 Mar 2020 13:43:26 +0100 Subject: Fix total videos stats --- server/tests/api/server/stats.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'server/tests') diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index c207bb5f0..fe956413c 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts @@ -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) }) -- cgit v1.2.3