]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/email.ts
Merge branch 'release/v1.3.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / email.ts
index 9ccb1c36fd0fa2e8d7138f1d643b4f4580388008..5929a3adbe6fc004f6d4da0420abb6e356d0a927 100644 (file)
@@ -37,15 +37,17 @@ describe('Test emails', function () {
     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)
@@ -134,7 +136,7 @@ describe('Test emails', function () {
 
       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)
     })