This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/server/mailer.test.js
2017-11-18 13:11:12 -08:00

22 lines
497 B
JavaScript

/* eslint-disable flowtype/require-valid-file-annotation */
import { Mailer } from './mailer';
describe('Mailer', () => {
let fakeMailer;
let sendMailOutput;
beforeEach(() => {
process.env.SMTP_FROM_EMAIL = 'hello@example.com';
fakeMailer = new Mailer();
fakeMailer.transporter = {
sendMail: output => (sendMailOutput = output),
};
});
test('#welcome', () => {
fakeMailer.welcome('user@example.com');
expect(sendMailOutput).toMatchSnapshot();
});
});