Skip to content

Commit

Permalink
Update liveIntentIdSystem_spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
patmmccann authored Jan 15, 2025
1 parent 1828b5f commit 0de9cce
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/spec/modules/liveIntentIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ describe('LiveIntentId', function() {
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sonobi': 'bar'}, 'sonobi': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
});

it('should decode a triplelift id to a separate object when present', function() {
const result = liveIntentExternalIdSubmodule.decode({ nonId: 'foo', triplelift: 'bar' }, defaultConfigParams);
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'triplelift': 'bar'}, 'triplelift': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
});

it('should decode a vidazoo id to a separate object when present', function() {
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', vidazoo: 'bar' }, { params: defaultConfigParams });
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'vidazoo': 'bar'}, 'vidazoo': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
Expand Down Expand Up @@ -887,6 +892,39 @@ describe('LiveIntentId', function() {
});
});

it('triplelift', function () {
const userId = {
sonobi: { 'id': 'sample_id' }
};
const newEids = createEidsArray(userId);
expect(newEids.length).to.equal(1);
expect(newEids[0]).to.deep.equal({
source: 'liveintent.triplelift.com',
uids: [{
id: 'sample_id',
atype: 3
}]
});
});

it('triplelift with ext', function () {
const userId = {
triplelift: { 'id': 'sample_id', 'ext': { 'provider': 'some.provider.com' } }
};
const newEids = createEidsArray(userId);
expect(newEids.length).to.equal(1);
expect(newEids[0]).to.deep.equal({
source: 'liveintent.triplelift.com',
uids: [{
id: 'sample_id',
atype: 3,
ext: {
provider: 'some.provider.com'
}
}]
});
});

it('vidazoo', function () {
const userId = {
vidazoo: { 'id': 'sample_id' }
Expand Down

0 comments on commit 0de9cce

Please sign in to comment.