mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
Added test to ensure events are only fetched if configured
refs https://github.com/TryGhost/Toolbox/issues/363 - this adds coverage for a branch in the code, and ensures we don't fetch any events if mailgun is not configured
This commit is contained in:
parent
843bbfa55d
commit
3e6416431e
@ -88,6 +88,15 @@ describe('MailgunClient', function () {
|
||||
});
|
||||
|
||||
describe('fetchEvents()', function () {
|
||||
it('does not fetch if not configured', async function () {
|
||||
const batchHandler = sinon.spy();
|
||||
const mailgunClient = new MailgunClient({config, settings});
|
||||
const events = await mailgunClient.fetchEvents(MAILGUN_OPTIONS, batchHandler);
|
||||
|
||||
assert.equal(events.length, 0);
|
||||
assert.equal(batchHandler.callCount, 0);
|
||||
});
|
||||
|
||||
it('fetches from now and works backwards', async function () {
|
||||
const configStub = sinon.stub(config, 'get');
|
||||
configStub.withArgs('bulkEmail').returns({
|
||||
|
Loading…
Reference in New Issue
Block a user