mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
54b62094c8
* feat(core): wrap aliyun direct mail connector * feat(core): remove copyfiles and reorganize files
26 lines
814 B
TypeScript
26 lines
814 B
TypeScript
import { singleSendMail } from './single-send-mail';
|
|
import { request } from './utils';
|
|
|
|
jest.mock('./utils');
|
|
|
|
describe('singleSendMail', () => {
|
|
it('should call request with action SingleSendMail', async () => {
|
|
await singleSendMail(
|
|
{
|
|
AccessKeyId: '<access-key-id>',
|
|
AccountName: 'noreply@example.com',
|
|
AddressType: '1',
|
|
FromAlias: 'CompanyName',
|
|
HtmlBody: 'test from logto',
|
|
ReplyToAddress: 'false',
|
|
Subject: 'test',
|
|
ToAddress: 'user@example.com',
|
|
},
|
|
'<access-key-secret>'
|
|
);
|
|
const calledData = (request as jest.MockedFunction<typeof request>).mock.calls[0];
|
|
expect(calledData).not.toBeUndefined();
|
|
const payload = calledData?.[1];
|
|
expect(payload).toHaveProperty('Action', 'SingleSendMail');
|
|
});
|
|
});
|