mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added test to check sending emails when Mailgun is not configured
- this tests the early-return path linked to Mailgun not being configured
This commit is contained in:
parent
ddbee90c1c
commit
f9b90a3cfe
2 changed files with 10 additions and 1 deletions
|
@ -34,7 +34,7 @@ module.exports = class MailgunClient {
|
|||
const mailgunInstance = this.getInstance();
|
||||
if (!mailgunInstance) {
|
||||
logging.warn(`Mailgun is not configured`);
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Object.keys(recipientData).length > module.exports.BATCH_SIZE) {
|
||||
|
|
|
@ -87,6 +87,15 @@ describe('MailgunClient', function () {
|
|||
assert.equal(eventsMock2.isDone(), true);
|
||||
});
|
||||
|
||||
describe('send()', function () {
|
||||
it('does not send if not configured', async function () {
|
||||
const mailgunClient = new MailgunClient({config, settings});
|
||||
const response = await mailgunClient.send({}, {}, []);
|
||||
|
||||
assert.strictEqual(response, null);
|
||||
});
|
||||
});
|
||||
|
||||
describe('fetchEvents()', function () {
|
||||
it('does not fetch if not configured', async function () {
|
||||
const batchHandler = sinon.spy();
|
||||
|
|
Loading…
Add table
Reference in a new issue