feat(api): show the verification code in the SES mailbox
CI / checks (pull_request) Failing after 12m24s

This commit is contained in:
Zakaria
2026-10-24 01:23:56 -04:00
parent 4bc8da6ee1
commit d457c08b12
3 changed files with 22 additions and 0 deletions
@@ -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: [