+ const res2 = await getUserInformation(server.url, server.accessToken, user17Id, true)
+ const user: User = res2.body
+
+ expect(user.videosCount).to.equal(1)
+ })
+
+ it('Should report correct video comments for user', async function () {
+ const text = 'super comment'
+ await addVideoCommentThread(server.url, user17AccessToken, videoId, text)
+
+ const res = await getUserInformation(server.url, server.accessToken, user17Id, true)
+ const user: User = res.body
+
+ expect(user.videoCommentsCount).to.equal(1)
+ })
+
+ it('Should report correct abuses counts', async function () {
+ const reason = 'my super bad reason'
+ await reportAbuse({ url: server.url, token: user17AccessToken, videoId, reason })
+
+ const res1 = await getAdminAbusesList({ url: server.url, token: server.accessToken })
+ const abuseId = res1.body.data[0].id
+
+ const res2 = await getUserInformation(server.url, server.accessToken, user17Id, true)
+ const user2: User = res2.body
+
+ expect(user2.abusesCount).to.equal(1) // number of incriminations
+ expect(user2.abusesCreatedCount).to.equal(1) // number of reports created
+
+ const body: AbuseUpdate = { state: AbuseState.ACCEPTED }
+ await updateAbuse(server.url, server.accessToken, abuseId, body)
+
+ const res3 = await getUserInformation(server.url, server.accessToken, user17Id, true)
+ const user3: User = res3.body
+
+ expect(user3.abusesAcceptedCount).to.equal(1) // number of reports created accepted
+ })