aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/contact-form.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/contact-form.ts')
-rw-r--r--server/tests/api/check-params/contact-form.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts
index d2541777f..8c2b2a84b 100644
--- a/server/tests/api/check-params/contact-form.ts
+++ b/server/tests/api/check-params/contact-form.ts
@@ -2,11 +2,11 @@
2 2
3import 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/core-utils' 4import { HttpStatusCode } from '@shared/core-utils'
5import { cleanupTests, flushAndRunServer, killallServers, MockSmtpServer, reRunServer, ServerInfo } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, killallServers, MockSmtpServer, PeerTubeServer } from '@shared/extra-utils'
6import { ContactFormCommand } from '@shared/extra-utils/server' 6import { ContactFormCommand } from '@shared/extra-utils/server'
7 7
8describe('Test contact form API validators', function () { 8describe('Test contact form API validators', function () {
9 let server: ServerInfo 9 let server: PeerTubeServer
10 const emails: object[] = [] 10 const emails: object[] = []
11 const defaultBody = { 11 const defaultBody = {
12 fromName: 'super name', 12 fromName: 'super name',
@@ -25,7 +25,7 @@ describe('Test contact form API validators', function () {
25 emailPort = await MockSmtpServer.Instance.collectEmails(emails) 25 emailPort = await MockSmtpServer.Instance.collectEmails(emails)
26 26
27 // Email is disabled 27 // Email is disabled
28 server = await flushAndRunServer(1) 28 server = await createSingleServer(1)
29 command = server.contactForm 29 command = server.contactForm
30 }) 30 })
31 31
@@ -39,7 +39,7 @@ describe('Test contact form API validators', function () {
39 await killallServers([ server ]) 39 await killallServers([ server ])
40 40
41 // Contact form is disabled 41 // Contact form is disabled
42 await reRunServer(server, { smtp: { hostname: 'localhost', port: emailPort }, contact_form: { enabled: false } }) 42 await server.run({ smtp: { hostname: 'localhost', port: emailPort }, contact_form: { enabled: false } })
43 await command.send({ ...defaultBody, expectedStatus: HttpStatusCode.CONFLICT_409 }) 43 await command.send({ ...defaultBody, expectedStatus: HttpStatusCode.CONFLICT_409 })
44 }) 44 })
45 45
@@ -49,7 +49,7 @@ describe('Test contact form API validators', function () {
49 await killallServers([ server ]) 49 await killallServers([ server ])
50 50
51 // Email & contact form enabled 51 // Email & contact form enabled
52 await reRunServer(server, { smtp: { hostname: 'localhost', port: emailPort } }) 52 await server.run({ smtp: { hostname: 'localhost', port: emailPort } })
53 53
54 await command.send({ ...defaultBody, fromEmail: 'badEmail', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 54 await command.send({ ...defaultBody, fromEmail: 'badEmail', expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
55 await command.send({ ...defaultBody, fromEmail: 'badEmail@', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 55 await command.send({ ...defaultBody, fromEmail: 'badEmail@', expectedStatus: HttpStatusCode.BAD_REQUEST_400 })