import { HttpStatusCode } from '@shared/models'
import {
cleanupTests,
+ ConfigCommand,
ContactFormCommand,
createSingleServer,
PeerTubeServer,
const port = await MockSmtpServer.Instance.collectEmails(emails)
- const overrideConfig = {
- smtp: {
- hostname: 'localhost',
- port
- }
- }
- server = await createSingleServer(1, overrideConfig)
+ server = await createSingleServer(1, ConfigCommand.getEmailOverrideConfig(port))
await setAccessTokensToServers([ server ])
command = server.contactForm
})
it('Should send a contact form', async function () {
- this.timeout(10000)
-
await command.send({
fromEmail: 'toto@example.com',
body: 'my super message',
const email = emails[0]
- expect(email['from'][0]['address']).equal('test-admin@localhost')
+ expect(email['from'][0]['address']).equal('test-admin@127.0.0.1')
expect(email['replyTo'][0]['address']).equal('toto@example.com')
expect(email['to'][0]['address']).equal('admin' + server.internalServerNumber + '@example.com')
expect(email['subject']).contains('my subject')
})
it('Should not be able to send another contact form because of the anti spam checker', async function () {
- this.timeout(10000)
-
await wait(1000)
await command.send({