]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/contact-form.ts
Merge branch 'feature/SO035' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / contact-form.ts
index 4f01f6fd50fb41f3b5d4ca876a9f3c96df79b51a..3252180085da206670ecae5cd763b796a79d064c 100644 (file)
@@ -1,7 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
 import { MockSmtpServer } from '@server/tests/shared'
 import { wait } from '@shared/core-utils'
 import { HttpStatusCode } from '@shared/models'
@@ -14,8 +13,6 @@ import {
   waitJobs
 } from '@shared/server-commands'
 
-const expect = chai.expect
-
 describe('Test contact form', function () {
   let server: PeerTubeServer
   const emails: object[] = []
@@ -28,7 +25,7 @@ describe('Test contact form', function () {
 
     const overrideConfig = {
       smtp: {
-        hostname: 'localhost',
+        hostname: '127.0.0.1',
         port
       }
     }
@@ -54,14 +51,14 @@ describe('Test contact form', function () {
 
     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')
     expect(email['text']).contains('my super message')
   })
 
-  it('Should not have duplicated email adress in text message', async function () {
+  it('Should not have duplicated email address in text message', async function () {
     const text = emails[0]['text'] as string
 
     const matches = text.match(/toto@example.com/g)