Skip to content

Commit

Permalink
added specs
Browse files Browse the repository at this point in the history
  • Loading branch information
f-w committed Jun 25, 2021
1 parent d6061c4 commit ca247ec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/__tests__/acceptance/notification.acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,17 @@ describe('POST /notifications', function () {
});

it('should skip broadcast email notification with un-matching filter', async function () {
const origConfig = await app.get(CoreBindings.APPLICATION_CONFIG);
app.bind(CoreBindings.APPLICATION_CONFIG).to(
_.merge({}, origConfig, {
notification: {
broadcastSubscriberChunkSize: 1,
broadcastSubRequestBatchSize: 10,
logSkippedBroadcastPushDispatches: true,
},
}),
);

sinon
.stub(BaseCrudRepository.prototype, 'isAdminReq')
.callsFake(async () => true);
Expand Down Expand Up @@ -992,6 +1003,8 @@ describe('POST /notifications', function () {
});
expect(data.length).equal(1);
expect(data[0].state).equal('sent');
expect(data[0].dispatch?.skipped).containEql('5');
app.bind(CoreBindings.APPLICATION_CONFIG).to(origConfig);
});

it('should update bounce record after sending unicast email notification', async function () {
Expand Down

0 comments on commit ca247ec

Please sign in to comment.