Skip to content

Commit 114f325

Browse files
LE - add unit test for missing conditions
1 parent 66792ad commit 114f325

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

test/src/tests.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3343,6 +3343,43 @@ describe('Rokt Forwarder', () => {
33433343
saleSeeker: true,
33443344
});
33453345
});
3346+
it('should support event attribute mapping when conditions are not defined', async () => {
3347+
const placementEventAttributeMapping = JSON.stringify([
3348+
{
3349+
jsmap: null,
3350+
map: 'URL',
3351+
maptype: 'EventAttributeClass.Name',
3352+
value: 'hasUrl',
3353+
},
3354+
]);
3355+
3356+
await window.mParticle.forwarder.init(
3357+
{
3358+
accountId: '123456',
3359+
placementEventAttributeMapping,
3360+
},
3361+
reportService.cb,
3362+
true,
3363+
null,
3364+
{}
3365+
);
3366+
3367+
await waitForCondition(() => window.mParticle.Rokt.attachKitCalled);
3368+
3369+
window.mParticle._Store.localSessionAttributes = {};
3370+
window.mParticle.forwarder.process({
3371+
EventName: 'Browse',
3372+
EventCategory: EventType.Unknown,
3373+
EventDataType: MessageType.PageView,
3374+
EventAttributes: {
3375+
URL: 'https://example.com/anything',
3376+
},
3377+
});
3378+
3379+
window.mParticle._Store.localSessionAttributes.should.deepEqual({
3380+
hasUrl: true,
3381+
});
3382+
});
33463383

33473384
it('should support exists operator for placementEventAttributeMapping conditions', async () => {
33483385
const placementEventAttributeMapping = JSON.stringify([

0 commit comments

Comments
 (0)