/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import * as chai from 'chai'
import 'mocha'
+import * as chai from 'chai'
import {
addVideoToBlacklist,
askResetPassword,
createUser,
flushAndRunServer,
removeVideoFromBlacklist,
- reportVideoAbuse,
+ reportAbuse,
resetPassword,
ServerInfo,
setAccessTokensToServers,
let userId: number
let userId2: number
let userAccessToken: string
+
let videoUUID: string
+ let videoId: number
+
let videoUserUUID: string
+
let verificationString: string
let verificationString2: string
+
const emails: object[] = []
const user = {
username: 'user_1',
}
const res = await uploadVideo(server.url, server.accessToken, attributes)
videoUUID = res.body.video.uuid
+ videoId = res.body.video.id
}
})
await resetPassword(server.url, userId, verificationString, 'super_password2')
})
+ it('Should not reset the password with the same verification string', async function () {
+ await resetPassword(server.url, userId, verificationString, 'super_password3', 403)
+ })
+
it('Should login with this new password', async function () {
user.password = 'super_password2'
})
})
- describe('When creating a video abuse', function () {
+ describe('When creating an abuse', function () {
it('Should send the notification email', async function () {
this.timeout(10000)
const reason = 'my super bad reason'
- await reportVideoAbuse(server.url, server.accessToken, videoUUID, reason)
+ await reportAbuse({ url: server.url, token: server.accessToken, videoId, reason })
await waitJobs(server)
expect(emails).to.have.lengthOf(3)