Skip to content

Commit

Permalink
LiveIntent user id module: Increase wait time and fix test config par…
Browse files Browse the repository at this point in the history
…ameters (prebid#11389)

* Increase wait time and fox test config parameters

* Remove superfluous breaces
  • Loading branch information
3link authored and DecayConstant committed Jul 18, 2024
1 parent 8b18422 commit 009ea06
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions test/spec/modules/liveIntentIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,26 @@ describe('LiveIntentId', function() {
setTimeout(() => {
expect(server.requests[0].url).to.match(/https:\/\/rp.liadm.com\/j\?.*&us_privacy=1YNY.*&wpn=prebid.*&gdpr=1&n3pc=1&n3pct=1&nb=1&gdpr_consent=consentDataString&gpp_s=gppConsentDataString&gpp_as=1.*/);
done();
}, 200);
}, 300);
});

it('should fire an event when getId and a hash is provided', function(done) {
liveIntentIdSubmodule.getId({ params: {
...defaultConfigParams,
...defaultConfigParams.params,
emailHash: '58131bc547fb87af94cebdaf3102321f'
}});
setTimeout(() => {
expect(server.requests[0].url).to.match(/https:\/\/rp.liadm.com\/j\?.*e=58131bc547fb87af94cebdaf3102321f.+/)
done();
}, 200);
}, 300);
});

it('should initialize LiveConnect and forward the prebid version when decode and emit an event', function(done) {
liveIntentIdSubmodule.decode({}, { params: {
...defaultConfigParams
}});
liveIntentIdSubmodule.decode({}, defaultConfigParams);
setTimeout(() => {
expect(server.requests[0].url).to.contain('tv=$prebid.version$')
done();
}, 200);
}, 300);
});

it('should initialize LiveConnect with the config params when decode and emit an event', function (done) {
Expand All @@ -123,15 +121,15 @@ describe('LiveIntentId', function() {
setTimeout(() => {
expect(server.requests[0].url).to.match(/https:\/\/collector.liveintent.com\/j\?.*aid=a-0001.*&wpn=prebid.*/);
done();
}, 200);
}, 300);
});

it('should fire an event with the provided distributorId', function (done) {
liveIntentIdSubmodule.decode({}, { params: { fireEventDelay: 1, distributorId: 'did-1111' } });
setTimeout(() => {
expect(server.requests[0].url).to.match(/https:\/\/rp.liadm.com\/j\?.*did=did-1111.*&wpn=prebid.*/);
done();
}, 200);
}, 300);
});

it('should fire an event without the provided distributorId when appId is provided', function (done) {
Expand All @@ -140,7 +138,7 @@ describe('LiveIntentId', function() {
expect(server.requests[0].url).to.match(/https:\/\/rp.liadm.com\/j\?.*aid=a-0001.*&wpn=prebid.*/);
expect(server.requests[0].url).to.not.match(/.*did=*/);
done();
}, 200);
}, 300);
});

it('should initialize LiveConnect and emit an event with a privacy string when decode', function(done) {
Expand All @@ -157,7 +155,7 @@ describe('LiveIntentId', function() {
setTimeout(() => {
expect(server.requests[0].url).to.match(/.*us_privacy=1YNY.*&gdpr=0&gdpr_consent=consentDataString.*&gpp_s=gppConsentDataString&gpp_as=1.*/);
done();
}, 200);
}, 300);
});

it('should fire an event when decode and a hash is provided', function(done) {
Expand All @@ -168,11 +166,11 @@ describe('LiveIntentId', function() {
setTimeout(() => {
expect(server.requests[0].url).to.match(/https:\/\/rp.liadm.com\/j\?.*e=58131bc547fb87af94cebdaf3102321f.+/);
done();
}, 200);
}, 300);
});

it('should not return a decoded identifier when the unifiedId is not present in the value', function() {
const result = liveIntentIdSubmodule.decode({ additionalData: 'data' });
const result = liveIntentIdSubmodule.decode({ fireEventDelay: 1, additionalData: 'data' });
expect(result).to.be.eql({});
});

Expand All @@ -181,7 +179,7 @@ describe('LiveIntentId', function() {
setTimeout(() => {
expect(server.requests[0].url).to.be.not.null
done();
}, 200);
}, 300);
});

it('should initialize LiveConnect and send data only once', function(done) {
Expand All @@ -192,7 +190,7 @@ describe('LiveIntentId', function() {
setTimeout(() => {
expect(server.requests.length).to.be.eq(1);
done();
}, 200);
}, 300);
});

it('should call the custom URL of the LiveIntent Identity Exchange endpoint', function() {
Expand Down

0 comments on commit 009ea06

Please sign in to comment.