username: 'user_1',
password: 'super_password'
}
+ let emailPort: number
before(async function () {
- this.timeout(30000)
+ this.timeout(50000)
- await MockSmtpServer.Instance.collectEmails(emails)
+ emailPort = await MockSmtpServer.Instance.collectEmails(emails)
const overrideConfig = {
smtp: {
- hostname: 'localhost'
+ hostname: 'localhost',
+ port: emailPort
}
}
server = await flushAndRunServer(1, overrideConfig)
expect(email['from'][0]['name']).equal('localhost:' + server.port)
expect(email['from'][0]['address']).equal('test-admin@localhost')
- expect(email['to'][0]['address']).equal('admin1@example.com')
+ expect(email['to'][0]['address']).equal('admin' + server.internalServerNumber + '@example.com')
expect(email['subject']).contains('abuse')
expect(email['text']).contains(videoUUID)
})
})
it('Should not verify the email with an invalid verification string', async function () {
- await verifyEmail(server.url, userId, verificationString + 'b', 403)
+ await verifyEmail(server.url, userId, verificationString + 'b', false, 403)
})
it('Should verify the email', async function () {