+ await checkNewVideoAbuseForModerators({ ...baseParams, shortUUID: video.shortUUID, videoName: name, checkType: 'presence' })
+ })
+
+ it('Should send a notification to moderators on local comment abuse', async function () {
+ this.timeout(50000)
+
+ const name = 'video for abuse ' + buildUUID()
+ const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } })
+ const comment = await servers[0].comments.createThread({
+ token: userToken1,
+ videoId: video.id,
+ text: 'comment abuse ' + buildUUID()
+ })
+
+ await waitJobs(servers)
+
+ await servers[0].abuses.report({ token: userToken1, commentId: comment.id, reason: 'super reason' })
+
+ await waitJobs(servers)
+ await checkNewCommentAbuseForModerators({ ...baseParams, shortUUID: video.shortUUID, videoName: name, checkType: 'presence' })
+ })
+
+ it('Should send a notification to moderators on remote comment abuse', async function () {
+ this.timeout(50000)
+
+ const name = 'video for abuse ' + buildUUID()
+ const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } })
+
+ await servers[0].comments.createThread({
+ token: userToken1,
+ videoId: video.id,
+ text: 'comment abuse ' + buildUUID()
+ })
+
+ await waitJobs(servers)
+
+ const { data } = await servers[1].comments.listThreads({ videoId: video.uuid })
+ const commentId = data[0].id
+ await servers[1].abuses.report({ token: userToken2, commentId, reason: 'super reason' })
+
+ await waitJobs(servers)
+ await checkNewCommentAbuseForModerators({ ...baseParams, shortUUID: video.shortUUID, videoName: name, checkType: 'presence' })
+ })
+
+ it('Should send a notification to moderators on local account abuse', async function () {
+ this.timeout(50000)
+
+ const username = 'user' + new Date().getTime()
+ const { account } = await servers[0].users.create({ username, password: 'donald' })
+ const accountId = account.id
+
+ await servers[0].abuses.report({ token: userToken1, accountId, reason: 'super reason' })
+
+ await waitJobs(servers)
+ await checkNewAccountAbuseForModerators({ ...baseParams, displayName: username, checkType: 'presence' })
+ })
+
+ it('Should send a notification to moderators on remote account abuse', async function () {
+ this.timeout(50000)
+
+ const username = 'user' + new Date().getTime()
+ const tmpToken = await servers[0].users.generateUserAndToken(username)
+ await servers[0].videos.upload({ token: tmpToken, attributes: { name: 'super video' } })
+
+ await waitJobs(servers)
+
+ const account = await servers[1].accounts.get({ accountName: username + '@' + servers[0].host })
+ await servers[1].abuses.report({ token: userToken2, accountId: account.id, reason: 'super reason' })
+
+ await waitJobs(servers)
+ await checkNewAccountAbuseForModerators({ ...baseParams, displayName: username, checkType: 'presence' })