0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

updated listeners in test to be fully inclusive

no ref
-test wasn't previously updated to include all event listeners
This commit is contained in:
Steve Larson 2023-02-01 17:20:24 -06:00
parent ae92d1425d
commit 3186323663

View file

@ -27,7 +27,7 @@ describe('MentionSendingService', function () {
}); });
describe('listen', function () { describe('listen', function () {
it('Calls on post.edited', async function () { it('Calls on post.published, post.published.edited, post.unpublished', async function () {
const service = new MentionSendingService({}); const service = new MentionSendingService({});
const stub = sinon.stub(service, 'sendForPost').resolves(); const stub = sinon.stub(service, 'sendForPost').resolves();
let callback; let callback;
@ -37,7 +37,7 @@ describe('MentionSendingService', function () {
}) })
}; };
service.listen(events); service.listen(events);
sinon.assert.calledOnce(events.on); sinon.assert.calledThrice(events.on);
await callback({}); await callback({});
sinon.assert.calledOnce(stub); sinon.assert.calledOnce(stub);
}); });