feat(api): show the verification code in the SES mailbox
CI / checks (pull_request) Failing after 12m24s
CI / checks (pull_request) Failing after 12m24s
This commit is contained in:
@@ -46,6 +46,19 @@ describe('AwsSesAdapter', () => {
|
||||
})])
|
||||
})
|
||||
|
||||
test('picks out the code from verification emails', async () => {
|
||||
const adapter = new AwsSesAdapter('http://floci.test', async () => jsonResponse({
|
||||
messages: [
|
||||
{Id: 'cognito', Subject: 'Your verification code', Body: {text_part: 'Your verification code is 869472.'}},
|
||||
{Id: 'html', Subject: 'Reset', Body: {html_part: '<p>Your confirmation code is: <b>4410</b></p>'}},
|
||||
{Id: 'plain', Subject: 'Invoice', Body: {text_part: 'Order 123456 shipped.'}},
|
||||
],
|
||||
}))
|
||||
|
||||
const codes = (await adapter.list()).map((resource) => resource.metadata.code)
|
||||
expect(codes).toEqual(['869472', '4410', null])
|
||||
})
|
||||
|
||||
test('filters messages by subject, sender, and recipients', async () => {
|
||||
const adapter = new AwsSesAdapter('http://floci.test', async () => jsonResponse({
|
||||
messages: [
|
||||
|
||||
Reference in New Issue
Block a user