-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: generalise test cases, use snapshot testing
- Loading branch information
Showing
2 changed files
with
75 additions
and
28 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
src/app/services/mail/__tests__/__snapshots__/mail.service.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`mail.service sendBounceNotification should send permanent bounce notification successfully 1`] = ` | ||
[MockFunction] { | ||
"calls": [ | ||
[ | ||
{ | ||
"from": "mockApp <[email protected]>", | ||
"headers": { | ||
"X-Formsg-Email-Type": "Admin (bounce notification)", | ||
"X-Formsg-Form-ID": "mockFormId", | ||
}, | ||
"html": "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html dir="ltr" lang="en"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/></head><body><p style="font-size:14px;line-height:24px;margin:16px 0">Dear form admins(s),</p><p style="font-size:14px;line-height:24px;margin:16px 0">We’re reaching out urgently regarding your FormSG form You are all individuals!(mockApp.example.com/mockFormId). Responses to the following recipient(s) could not be delivered: [email protected], [email protected]. This was likely due to their mailbox being full.</p><p style="font-size:14px;line-height:24px;margin:16px 0">Please refer to our <a href="https://go.gov.sg/formsg-guide-bounces" style="color:#067df7;text-decoration:none" target="_blank">guide</a> for next steps on how to resolve this issue.</p><p style="font-size:14px;line-height:24px;margin:16px 0">The mockApp Support Team</p></body></html>", | ||
"subject": "[Urgent] FormSG Response Delivery Failure / Bounce", | ||
"to": [ | ||
"[email protected]", | ||
"[email protected]", | ||
], | ||
}, | ||
], | ||
], | ||
"results": [ | ||
{ | ||
"type": "return", | ||
"value": Promise {}, | ||
}, | ||
], | ||
} | ||
`; | ||
|
||
exports[`mail.service sendBounceNotification should send transient bounce notification successfully 1`] = ` | ||
[MockFunction] { | ||
"calls": [ | ||
[ | ||
{ | ||
"from": "mockApp <[email protected]>", | ||
"headers": { | ||
"X-Formsg-Email-Type": "Admin (bounce notification)", | ||
"X-Formsg-Form-ID": "mockFormId", | ||
}, | ||
"html": "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html dir="ltr" lang="en"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/></head><body><p style="font-size:14px;line-height:24px;margin:16px 0">Dear form admins(s),</p><p style="font-size:14px;line-height:24px;margin:16px 0">We’re reaching out urgently regarding your FormSG form You are all individuals!(mockApp.example.com/mockFormId). Responses to the following recipient(s) could not be delivered: [email protected], [email protected]. This was likely due to their mailbox being full.</p><p style="font-size:14px;line-height:24px;margin:16px 0">Please refer to our <a href="https://go.gov.sg/formsg-guide-bounces" style="color:#067df7;text-decoration:none" target="_blank">guide</a> for next steps on how to resolve this issue.</p><p style="font-size:14px;line-height:24px;margin:16px 0">The mockApp Support Team</p></body></html>", | ||
"subject": "[Urgent] FormSG Response Delivery Failure / Bounce", | ||
"to": [ | ||
"[email protected]", | ||
"[email protected]", | ||
], | ||
}, | ||
], | ||
], | ||
"results": [ | ||
{ | ||
"type": "return", | ||
"value": Promise {}, | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters