diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-19 09:28:29 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-01-19 13:53:40 +0100 |
commit | b379759f55a35837b803a3b988674972db2903d1 (patch) | |
tree | 895d556973fea9be21492fb60aec2ff7767f5b18 /server/tests/api/check-params/contact-form.ts | |
parent | 3e5716dd3a5b0db4a1db327714247da687419f92 (diff) | |
download | PeerTube-b379759f55a35837b803a3b988674972db2903d1.tar.gz PeerTube-b379759f55a35837b803a3b988674972db2903d1.tar.zst PeerTube-b379759f55a35837b803a3b988674972db2903d1.zip |
Add signup approval API tests
Diffstat (limited to 'server/tests/api/check-params/contact-form.ts')
-rw-r--r-- | server/tests/api/check-params/contact-form.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts index 7968ef802..f0f8819b9 100644 --- a/server/tests/api/check-params/contact-form.ts +++ b/server/tests/api/check-params/contact-form.ts | |||
@@ -2,7 +2,14 @@ | |||
2 | 2 | ||
3 | import { MockSmtpServer } from '@server/tests/shared' | 3 | import { MockSmtpServer } from '@server/tests/shared' |
4 | import { HttpStatusCode } from '@shared/models' | 4 | import { HttpStatusCode } from '@shared/models' |
5 | import { cleanupTests, ContactFormCommand, createSingleServer, killallServers, PeerTubeServer } from '@shared/server-commands' | 5 | import { |
6 | cleanupTests, | ||
7 | ConfigCommand, | ||
8 | ContactFormCommand, | ||
9 | createSingleServer, | ||
10 | killallServers, | ||
11 | PeerTubeServer | ||
12 | } from '@shared/server-commands' | ||
6 | 13 | ||
7 | describe('Test contact form API validators', function () { | 14 | describe('Test contact form API validators', function () { |
8 | let server: PeerTubeServer | 15 | let server: PeerTubeServer |
@@ -38,7 +45,7 @@ describe('Test contact form API validators', function () { | |||
38 | await killallServers([ server ]) | 45 | await killallServers([ server ]) |
39 | 46 | ||
40 | // Contact form is disabled | 47 | // Contact form is disabled |
41 | await server.run({ smtp: { hostname: '127.0.0.1', port: emailPort }, contact_form: { enabled: false } }) | 48 | await server.run({ ...ConfigCommand.getEmailOverrideConfig(emailPort), contact_form: { enabled: false } }) |
42 | await command.send({ ...defaultBody, expectedStatus: HttpStatusCode.CONFLICT_409 }) | 49 | await command.send({ ...defaultBody, expectedStatus: HttpStatusCode.CONFLICT_409 }) |
43 | }) | 50 | }) |
44 | 51 | ||
@@ -48,7 +55,7 @@ describe('Test contact form API validators', function () { | |||
48 | await killallServers([ server ]) | 55 | await killallServers([ server ]) |
49 | 56 | ||
50 | // Email & contact form enabled | 57 | // Email & contact form enabled |
51 | await server.run({ smtp: { hostname: '127.0.0.1', port: emailPort } }) | 58 | await server.run(ConfigCommand.getEmailOverrideConfig(emailPort)) |
52 | 59 | ||
53 | await command.send({ ...defaultBody, fromEmail: 'badEmail', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 60 | await command.send({ ...defaultBody, fromEmail: 'badEmail', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
54 | await command.send({ ...defaultBody, fromEmail: 'badEmail@', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 61 | await command.send({ ...defaultBody, fromEmail: 'badEmail@', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |