Skip to content

Commit

Permalink
test: Add test to confirm unmapped events do not get sent
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi22186 committed Sep 29, 2023
1 parent 00ca0a7 commit 6fe7530
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,28 @@ describe('DoubleClick', function () {
done();
});

it('should not log an event that is not mapped', function(done) {
window.dataLayer = [];
var result = mParticle.forwarder.process({
EventDataType: MessageTypes.PageEvent,
EventCategory: mParticle.EventType.Unknown,
EventName: 'abcdef',
EventAttributes: {
'Total Amount': 123,
color: 'blue',
},
CustomFlags: {
'DoubleClick.Counter': 'standard',
},
});

result.should.equal(
'Error logging event or event type not supported on forwarder DoubleclickDFP'
);

done();
});

it('should not log a product purchase commerce event without a custom flag or with an incorrect custom flag', function(done) {
window.dataLayer = [];

Expand Down

0 comments on commit 6fe7530

Please sign in to comment.