aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorNassim Bounouas <NassimBounouas@users.noreply.github.com>2019-06-21 08:49:35 +0200
committerChocobozzz <me@florianbigard.com>2019-06-21 08:49:35 +0200
commit4e9fa5b7e9ca6030a5fe2e9b0520bf8fa18e5877 (patch)
treef7fb09aa655f954b8d9833cd2215f6fada5721a6 /server/tests
parentd1ea2a988d05e1eca4066efb99c5f943f5267a78 (diff)
downloadPeerTube-4e9fa5b7e9ca6030a5fe2e9b0520bf8fa18e5877.tar.gz
PeerTube-4e9fa5b7e9ca6030a5fe2e9b0520bf8fa18e5877.tar.zst
PeerTube-4e9fa5b7e9ca6030a5fe2e9b0520bf8fa18e5877.zip
Feature/subject in contact form (#1926)
* #1915 Add a subject to contact form and add it to email sent * #1915 Add subject to contact form tests * #1915 Contact form test corrected && tslint correction
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/check-params/contact-form.ts1
-rw-r--r--server/tests/api/server/contact-form.ts10
2 files changed, 8 insertions, 3 deletions
diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts
index dbdd3a8a6..b3051945e 100644
--- a/server/tests/api/check-params/contact-form.ts
+++ b/server/tests/api/check-params/contact-form.ts
@@ -26,6 +26,7 @@ describe('Test contact form API validators', function () {
26 const defaultBody = { 26 const defaultBody = {
27 fromName: 'super name', 27 fromName: 'super name',
28 fromEmail: 'toto@example.com', 28 fromEmail: 'toto@example.com',
29 subject: 'my subject',
29 body: 'Hello, how are you?' 30 body: 'Hello, how are you?'
30 } 31 }
31 let emailPort: number 32 let emailPort: number
diff --git a/server/tests/api/server/contact-form.ts b/server/tests/api/server/contact-form.ts
index 87e55060c..e4e895acb 100644
--- a/server/tests/api/server/contact-form.ts
+++ b/server/tests/api/server/contact-form.ts
@@ -43,6 +43,7 @@ describe('Test contact form', function () {
43 url: server.url, 43 url: server.url,
44 fromEmail: 'toto@example.com', 44 fromEmail: 'toto@example.com',
45 body: 'my super message', 45 body: 'my super message',
46 subject: 'my subject',
46 fromName: 'Super toto' 47 fromName: 'Super toto'
47 }) 48 })
48 49
@@ -55,7 +56,7 @@ describe('Test contact form', function () {
55 expect(email['from'][0]['address']).equal('test-admin@localhost') 56 expect(email['from'][0]['address']).equal('test-admin@localhost')
56 expect(email['from'][0]['name']).equal('toto@example.com') 57 expect(email['from'][0]['name']).equal('toto@example.com')
57 expect(email['to'][0]['address']).equal('admin' + server.internalServerNumber + '@example.com') 58 expect(email['to'][0]['address']).equal('admin' + server.internalServerNumber + '@example.com')
58 expect(email['subject']).contains('Contact form') 59 expect(email['subject']).contains('my subject')
59 expect(email['text']).contains('my super message') 60 expect(email['text']).contains('my super message')
60 }) 61 })
61 62
@@ -64,6 +65,7 @@ describe('Test contact form', function () {
64 url: server.url, 65 url: server.url,
65 fromEmail: 'toto@example.com', 66 fromEmail: 'toto@example.com',
66 body: 'my super message', 67 body: 'my super message',
68 subject: 'my subject',
67 fromName: 'Super toto' 69 fromName: 'Super toto'
68 }) 70 })
69 71
@@ -72,6 +74,7 @@ describe('Test contact form', function () {
72 fromEmail: 'toto@example.com', 74 fromEmail: 'toto@example.com',
73 body: 'my super message', 75 body: 'my super message',
74 fromName: 'Super toto', 76 fromName: 'Super toto',
77 subject: 'my subject',
75 expectedStatus: 403 78 expectedStatus: 403
76 }) 79 })
77 }) 80 })
@@ -82,8 +85,9 @@ describe('Test contact form', function () {
82 await sendContactForm({ 85 await sendContactForm({
83 url: server.url, 86 url: server.url,
84 fromEmail: 'toto@example.com', 87 fromEmail: 'toto@example.com',
85 body: 'my super message', 88 fromName: 'Super toto',
86 fromName: 'Super toto' 89 subject: 'my subject',
90 body: 'my super message'
87 }) 91 })
88 }) 92 })
89 93