-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import * as chai from 'chai'
import 'mocha'
import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
import { User } from '../../../../shared/models/users'
+import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
const expect = chai.expect
})
it('Should register user and send verification email if verification required', async function () {
- this.timeout(5000)
+ this.timeout(30000)
+
await updateCustomSubConfig(server.url, server.accessToken, {
signup: {
enabled: true,
})
it('Should not allow login for user with unverified email', async function () {
- const resLogin = await login(server.url, server.client, user1, 400)
- expect(resLogin.body.error).to.contain('User email is not verified.')
+ const resLogin = await login(server.url, server.client, user1, HttpStatusCode.BAD_REQUEST_400)
+ expect(resLogin.body.detail).to.contain('User email is not verified.')
})
it('Should verify the user via email and allow login', async function () {
})
it('Should be able to change the user email', async function () {
+ this.timeout(10000)
+
let updateVerificationString: string
{
await updateMyUser({
url: server.url,
accessToken: userAccessToken,
- email: 'updated@example.com'
+ email: 'updated@example.com',
+ currentPassword: user1.password
})
await waitJobs(server)