-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Features 1. Allow CC recipients in postman action ### UI changes 1. Show connected pipes in Tiles list 2. Allow users to upload secret key in FormSG connection step 3. Show confirmation when deleting tile 4. UI improvements for tiles (auto focus inputs, button size, etc) ### Others 1. Add tracking of users' last logged in
- Loading branch information
Showing
48 changed files
with
1,295 additions
and
149 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -105,5 +105,5 @@ | |
"tsconfig-paths": "^4.2.0", | ||
"type-fest": "4.10.3" | ||
}, | ||
"version": "1.30.0" | ||
"version": "1.31.0" | ||
} |
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
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 |
---|---|---|
|
@@ -225,6 +225,25 @@ describe('send transactional email', () => { | |
}) | ||
}) | ||
|
||
it('should send to CC recipients', async () => { | ||
const recipients = ['[email protected]', '[email protected]'] | ||
const ccRecipients = ['[email protected]', '[email protected]'] | ||
$.step.parameters.destinationEmail = recipients.join(',') | ||
$.step.parameters.destinationEmailCc = ccRecipients.join(',') | ||
await expect(sendTransactionalEmail.run($)).resolves.not.toThrow() | ||
expect($.setActionItem).toHaveBeenCalledWith({ | ||
raw: { | ||
status: ['ACCEPTED', 'ACCEPTED'], | ||
recipient: recipients, | ||
subject: 'test subject', | ||
body: 'test body', | ||
cc: ccRecipients, | ||
from: 'jack', | ||
reply_to: '[email protected]', | ||
}, | ||
}) | ||
}) | ||
|
||
it('should throw partial step error if one succeeds while the rest are blacklists', async () => { | ||
const recipients = ['[email protected]', '[email protected]'] | ||
$.step.parameters.destinationEmail = recipients.join(',') | ||
|
@@ -444,6 +463,7 @@ describe('send transactional email', () => { | |
recipient: recipients, | ||
}, | ||
}) | ||
$.execution.testRun = false | ||
await expect(sendTransactionalEmail.run($)).resolves.not.toThrow() | ||
expect($.http.post).toBeCalledTimes(4) | ||
expect($.setActionItem).toHaveBeenCalledWith({ | ||
|
@@ -457,4 +477,42 @@ describe('send transactional email', () => { | |
}, | ||
}) | ||
}) | ||
|
||
it('should send to all recipients in test runs', async () => { | ||
const recipients = [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
] | ||
$.step.parameters.destinationEmail = recipients.join(',') | ||
$.getLastExecutionStep = vi.fn().mockResolvedValueOnce({ | ||
status: 'success', | ||
errorDetails: 'error error', | ||
dataOut: { | ||
status: [ | ||
'BLACKLISTED', | ||
'ACCEPTED', | ||
'INTERMITTENT-ERROR', | ||
'ERROR', | ||
'RATE-LIMITED', | ||
], | ||
recipient: recipients, | ||
}, | ||
}) | ||
$.execution.testRun = true | ||
await expect(sendTransactionalEmail.run($)).resolves.not.toThrow() | ||
expect($.http.post).toBeCalledTimes(5) | ||
expect($.setActionItem).toHaveBeenCalledWith({ | ||
raw: { | ||
status: ['ACCEPTED', 'ACCEPTED', 'ACCEPTED', 'ACCEPTED', 'ACCEPTED'], | ||
recipient: recipients, | ||
subject: 'test subject', | ||
body: 'test body', | ||
from: 'jack', | ||
reply_to: '[email protected]', | ||
}, | ||
}) | ||
}) | ||
}) |
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 |
---|---|---|
|
@@ -129,4 +129,30 @@ describe('postman transactional email schema zod validation', () => { | |
assert(result.success === true) | ||
expect(result.data.body).toBe('hello<br>hihi') | ||
}) | ||
|
||
it('should validate multiple valid CC emails', () => { | ||
validPayload.destinationEmailCc = | ||
'[email protected], [email protected],[email protected]' | ||
const result = transactionalEmailSchema.safeParse(validPayload) | ||
assert(result.success === true) // using assert here for type assertion | ||
expect(result.data.destinationEmailCc).toEqual([ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
]) | ||
}) | ||
|
||
const invalidCcRecipients: string[][] = [ | ||
['invalid-cc-recipient'], | ||
['invalid-cc-recipient2', '[email protected]'], | ||
] | ||
it.each(invalidCcRecipients)( | ||
'should fail if invalid CC recipient', | ||
(...ccRecipients: string[]) => { | ||
validPayload.destinationEmailCc = ccRecipients.join(',') | ||
const result = transactionalEmailSchema.safeParse(validPayload) | ||
assert(result.success === false) | ||
expect(result.error?.errors[0].message).toEqual('Invalid CC emails') | ||
}, | ||
) | ||
}) |
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
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
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
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
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
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
Oops, something went wrong.