]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/contact-form.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / contact-form.ts
index 1df9993da04d9aee29383d9dfb4e8b3bf06419a8..f0f8819b923d7c1b0023279c1c999cc96ecf6589 100644 (file)
@@ -1,9 +1,15 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import { cleanupTests, createSingleServer, killallServers, MockSmtpServer, PeerTubeServer } from '@shared/extra-utils'
-import { ContactFormCommand } from '@shared/extra-utils/server'
+import { MockSmtpServer } from '@server/tests/shared'
 import { HttpStatusCode } from '@shared/models'
+import {
+  cleanupTests,
+  ConfigCommand,
+  ContactFormCommand,
+  createSingleServer,
+  killallServers,
+  PeerTubeServer
+} from '@shared/server-commands'
 
 describe('Test contact form API validators', function () {
   let server: PeerTubeServer
@@ -34,22 +40,22 @@ describe('Test contact form API validators', function () {
   })
 
   it('Should not accept a contact form if it is disabled in the configuration', async function () {
-    this.timeout(10000)
+    this.timeout(25000)
 
     await killallServers([ server ])
 
     // Contact form is disabled
-    await server.run({ smtp: { hostname: 'localhost', port: emailPort }, contact_form: { enabled: false } })
+    await server.run({ ...ConfigCommand.getEmailOverrideConfig(emailPort), contact_form: { enabled: false } })
     await command.send({ ...defaultBody, expectedStatus: HttpStatusCode.CONFLICT_409 })
   })
 
   it('Should not accept a contact form if from email is invalid', async function () {
-    this.timeout(10000)
+    this.timeout(25000)
 
     await killallServers([ server ])
 
     // Email & contact form enabled
-    await server.run({ smtp: { hostname: 'localhost', port: emailPort } })
+    await server.run(ConfigCommand.getEmailOverrideConfig(emailPort))
 
     await command.send({ ...defaultBody, fromEmail: 'badEmail', expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
     await command.send({ ...defaultBody, fromEmail: 'badEmail@', expectedStatus: HttpStatusCode.BAD_REQUEST_400 })