askResetPassword,
askSendVerifyEmail,
blockUser,
- createUser, removeVideoFromBlacklist,
+ cleanupTests,
+ createUser,
+ flushAndRunServer,
+ removeVideoFromBlacklist,
reportVideoAbuse,
resetPassword,
- flushAndRunServer,
+ ServerInfo,
+ setAccessTokensToServers,
unblockUser,
uploadVideo,
userLogin,
- verifyEmail,
- flushTests,
- killallServers,
- ServerInfo,
- setAccessTokensToServers, cleanupTests
+ verifyEmail
} from '../../../../shared/extra-utils'
import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
username: 'user_1',
password: 'super_password'
}
+ let emailPort: number
before(async function () {
this.timeout(30000)
- 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)
const email = emails[0]
- expect(email['from'][0]['name']).equal('localhost:9001')
+ expect(email['from'][0]['name']).equal('localhost:' + server.port)
expect(email['from'][0]['address']).equal('test-admin@localhost')
expect(email['to'][0]['address']).equal('user_1@example.com')
expect(email['subject']).contains('password')
const email = emails[1]
- expect(email['from'][0]['name']).equal('localhost:9001')
+ 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)
})
const email = emails[2]
- expect(email['from'][0]['name']).equal('localhost:9001')
+ expect(email['from'][0]['name']).equal('localhost:' + server.port)
expect(email['from'][0]['address']).equal('test-admin@localhost')
expect(email['to'][0]['address']).equal('user_1@example.com')
expect(email['subject']).contains(' blocked')
const email = emails[3]
- expect(email['from'][0]['name']).equal('localhost:9001')
+ expect(email['from'][0]['name']).equal('localhost:' + server.port)
expect(email['from'][0]['address']).equal('test-admin@localhost')
expect(email['to'][0]['address']).equal('user_1@example.com')
expect(email['subject']).contains(' unblocked')
const email = emails[4]
- expect(email['from'][0]['name']).equal('localhost:9001')
+ expect(email['from'][0]['name']).equal('localhost:' + server.port)
expect(email['from'][0]['address']).equal('test-admin@localhost')
expect(email['to'][0]['address']).equal('user_1@example.com')
expect(email['subject']).contains(' blacklisted')
const email = emails[5]
- expect(email['from'][0]['name']).equal('localhost:9001')
+ expect(email['from'][0]['name']).equal('localhost:' + server.port)
expect(email['from'][0]['address']).equal('test-admin@localhost')
expect(email['to'][0]['address']).equal('user_1@example.com')
expect(email['subject']).contains(' unblacklisted')
const email = emails[6]
- expect(email['from'][0]['name']).equal('localhost:9001')
+ expect(email['from'][0]['name']).equal('localhost:' + server.port)
expect(email['from'][0]['address']).equal('test-admin@localhost')
expect(email['to'][0]['address']).equal('user_1@example.com')
expect(email['subject']).contains('Verify')