+ it('Should have the correct total videos stats after an unfollow', async function () {
+ this.timeout(15000)
+
+ 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)
+ })
+
+ it('Should have the correct active users stats', async function () {
+ const server = servers[0]
+
+ {
+ const res = await getStats(server.url)
+ const data: ServerStats = res.body
+ expect(data.totalDailyActiveUsers).to.equal(1)
+ expect(data.totalWeeklyActiveUsers).to.equal(1)
+ expect(data.totalMonthlyActiveUsers).to.equal(1)
+ }
+
+ {
+ await userLogin(server, user)
+
+ const res = await getStats(server.url)
+ const data: ServerStats = res.body
+ expect(data.totalDailyActiveUsers).to.equal(2)
+ expect(data.totalWeeklyActiveUsers).to.equal(2)
+ expect(data.totalMonthlyActiveUsers).to.equal(2)
+ }
+ })
+