aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-13 16:18:42 +0200
committerChocobozzz <me@florianbigard.com>2021-10-13 16:18:42 +0200
commit1cf0df024e58432da39fe2d1b317fb5c9ab8bd2e (patch)
treea9e3e6e3330552fddda81688dd7ce69e099f0b05 /server/tests/api
parentf87d82b93d474d1290b3c641e63a39197193cb7e (diff)
downloadPeerTube-1cf0df024e58432da39fe2d1b317fb5c9ab8bd2e.tar.gz
PeerTube-1cf0df024e58432da39fe2d1b317fb5c9ab8bd2e.tar.zst
PeerTube-1cf0df024e58432da39fe2d1b317fb5c9ab8bd2e.zip
Fix actor follow counts calculation
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/server/auto-follows.ts8
-rw-r--r--server/tests/api/server/jobs.ts2
2 files changed, 4 insertions, 6 deletions
diff --git a/server/tests/api/server/auto-follows.ts b/server/tests/api/server/auto-follows.ts
index ce7b51925..ca6475bd5 100644
--- a/server/tests/api/server/auto-follows.ts
+++ b/server/tests/api/server/auto-follows.ts
@@ -19,16 +19,16 @@ async function checkFollow (follower: PeerTubeServer, following: PeerTubeServer,
19 const body = await following.follows.getFollowers({ start: 0, count: 5, sort: '-createdAt' }) 19 const body = await following.follows.getFollowers({ start: 0, count: 5, sort: '-createdAt' })
20 const follow = body.data.find(f => f.follower.host === follower.host && f.state === 'accepted') 20 const follow = body.data.find(f => f.follower.host === follower.host && f.state === 'accepted')
21 21
22 if (exists === true) expect(follow).to.exist 22 if (exists === true) expect(follow, `Follower ${follower.url} should exist on ${following.url}`).to.exist
23 else expect(follow).to.be.undefined 23 else expect(follow, `Follower ${follower.url} should not exist on ${following.url}`).to.be.undefined
24 } 24 }
25 25
26 { 26 {
27 const body = await follower.follows.getFollowings({ start: 0, count: 5, sort: '-createdAt' }) 27 const body = await follower.follows.getFollowings({ start: 0, count: 5, sort: '-createdAt' })
28 const follow = body.data.find(f => f.following.host === following.host && f.state === 'accepted') 28 const follow = body.data.find(f => f.following.host === following.host && f.state === 'accepted')
29 29
30 if (exists === true) expect(follow).to.exist 30 if (exists === true) expect(follow, `Following ${following.url} should exist on ${follower.url}`).to.exist
31 else expect(follow).to.be.undefined 31 else expect(follow, `Following ${following.url} should not exist on ${follower.url}`).to.be.undefined
32 } 32 }
33} 33}
34 34
diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts
index 937028e4f..8c4e01226 100644
--- a/server/tests/api/server/jobs.ts
+++ b/server/tests/api/server/jobs.ts
@@ -88,8 +88,6 @@ describe('Test jobs', function () {
88 const jobs = body.data 88 const jobs = body.data
89 expect(jobs).to.have.length.above(2) 89 expect(jobs).to.have.length.above(2)
90 90
91 // We know there are a least 1 delayed job (video views) and 1 completed job (broadcast)
92 expect(jobs.find(j => j.state === 'delayed')).to.not.be.undefined
93 expect(jobs.find(j => j.state === 'completed')).to.not.be.undefined 91 expect(jobs.find(j => j.state === 'completed')).to.not.be.undefined
94 }) 92 })
95 93