aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/server/stats.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts
index 332c09585..eb474c1f5 100644
--- a/server/tests/api/server/stats.ts
+++ b/server/tests/api/server/stats.ts
@@ -21,6 +21,7 @@ import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
21import { getStats } from '../../../../shared/extra-utils/server/stats' 21import { getStats } from '../../../../shared/extra-utils/server/stats'
22import { addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments' 22import { addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments'
23import { ServerStats } from '../../../../shared/models/server/server-stats.model' 23import { ServerStats } from '../../../../shared/models/server/server-stats.model'
24import { ActivityType } from '@shared/models'
24 25
25const expect = chai.expect 26const expect = chai.expect
26 27
@@ -201,6 +202,22 @@ describe('Test stats (excluding redundancy)', function () {
201 const second: ServerStats = res2.body 202 const second: ServerStats = res2.body
202 203
203 expect(second.totalActivityPubMessagesProcessed).to.be.greaterThan(first.totalActivityPubMessagesProcessed) 204 expect(second.totalActivityPubMessagesProcessed).to.be.greaterThan(first.totalActivityPubMessagesProcessed)
205 const apTypes: ActivityType[] = [
206 'Create', 'Update', 'Delete', 'Follow', 'Accept', 'Announce', 'Undo', 'Like', 'Reject', 'View', 'Dislike', 'Flag'
207 ]
208
209 const processed = apTypes.reduce(
210 (previous, type) => previous + second['totalActivityPub' + type + 'MessagesSuccesses'],
211 0
212 )
213 expect(second.totalActivityPubMessagesProcessed).to.equal(processed)
214 expect(second.totalActivityPubMessagesSuccesses).to.equal(processed)
215
216 expect(second.totalActivityPubMessagesErrors).to.equal(0)
217
218 for (const apType of apTypes) {
219 expect(second['totalActivityPub' + apType + 'MessagesErrors']).to.equal(0)
220 }
204 221
205 await wait(6000) 222 await wait(6000)
206 223