prebid.js 7.54.2 → 7.54.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagementGpp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +132 -132
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rtbhouseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/snigelBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/modules/consentManagementGpp.js +10 -1
- package/modules/ixBidAdapter.js +3 -1
- package/modules/liveIntentIdSystem.js +4 -0
- package/modules/optidigitalBidAdapter.js +21 -14
- package/modules/rtbhouseBidAdapter.js +9 -2
- package/modules/rtbhouseBidAdapter.md +27 -8
- package/modules/snigelBidAdapter.js +69 -16
- package/modules/snigelBidAdapter.md +9 -3
- package/modules/userId/eids.js +9 -0
- package/modules/userId/eids.md +8 -0
- package/package.json +1 -1
- package/test/spec/modules/consentManagementGpp_spec.js +14 -8
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/ixBidAdapter_spec.js +12 -6
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
- package/test/spec/modules/optidigitalBidAdapter_spec.js +9 -2
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +35 -0
- package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
|
@@ -525,18 +525,14 @@ describe('consentManagementGpp', function () {
|
|
|
525
525
|
})
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
-
function mockGppCmp(
|
|
528
|
+
function mockGppCmp(gppData, pingData = {cmpStatus: 'loaded'}) {
|
|
529
529
|
gppStub.callsFake((api, cb) => {
|
|
530
530
|
if (api === 'addEventListener') {
|
|
531
531
|
// eslint-disable-next-line standard/no-callback-literal
|
|
532
|
-
cb({
|
|
533
|
-
pingData: {
|
|
534
|
-
cmpStatus: 'loaded'
|
|
535
|
-
}
|
|
536
|
-
}, true);
|
|
532
|
+
cb({pingData}, true);
|
|
537
533
|
}
|
|
538
|
-
if (api === 'getGPPData') {
|
|
539
|
-
return
|
|
534
|
+
if (gppData != null && api === 'getGPPData') {
|
|
535
|
+
return gppData;
|
|
540
536
|
}
|
|
541
537
|
});
|
|
542
538
|
}
|
|
@@ -549,6 +545,16 @@ describe('consentManagementGpp', function () {
|
|
|
549
545
|
gppStub.restore();
|
|
550
546
|
})
|
|
551
547
|
|
|
548
|
+
it('should continue auction with null consent when CMP is not version 1.0', () => {
|
|
549
|
+
mockGppCmp(null, {cmpStatus: 'loaded', gppVersion: '1.1'});
|
|
550
|
+
return runAuction().then(() => {
|
|
551
|
+
sinon.assert.match(gppDataHandler.getConsentData(), {
|
|
552
|
+
gppString: undefined,
|
|
553
|
+
applicableSections: [],
|
|
554
|
+
})
|
|
555
|
+
})
|
|
556
|
+
})
|
|
557
|
+
|
|
552
558
|
it('should continue auction with null consent when CMP is unresponsive', () => {
|
|
553
559
|
return runAuction().then(() => {
|
|
554
560
|
const consent = gppDataHandler.getConsentData();
|
|
@@ -216,6 +216,21 @@ describe('eids array generation for known sub-modules', function() {
|
|
|
216
216
|
});
|
|
217
217
|
});
|
|
218
218
|
|
|
219
|
+
it('magnite', function() {
|
|
220
|
+
const userId = {
|
|
221
|
+
magnite: {'id': 'sample_id'}
|
|
222
|
+
};
|
|
223
|
+
const newEids = createEidsArray(userId);
|
|
224
|
+
expect(newEids.length).to.equal(1);
|
|
225
|
+
expect(newEids[0]).to.deep.equal({
|
|
226
|
+
source: 'rubiconproject.com',
|
|
227
|
+
uids: [{
|
|
228
|
+
id: 'sample_id',
|
|
229
|
+
atype: 3
|
|
230
|
+
}]
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
|
|
219
234
|
it('britepoolId', function() {
|
|
220
235
|
const userId = {
|
|
221
236
|
britepoolid: 'some-random-id-value'
|
|
@@ -756,7 +756,8 @@ describe('IndexexchangeAdapter', function () {
|
|
|
756
756
|
uid2: { id: 'testuid2' }, // UID 2.0
|
|
757
757
|
// similar to uid2, but id5's getValue takes .uid
|
|
758
758
|
id5id: { uid: 'testid5id' }, // ID5
|
|
759
|
-
imuid: 'testimuid'
|
|
759
|
+
imuid: 'testimuid',
|
|
760
|
+
'33acrossId': { envelope: 'v1.5fs.1000.fjdiosmclds' }
|
|
760
761
|
};
|
|
761
762
|
|
|
762
763
|
const DEFAULT_USERIDASEIDS_DATA = createEidsArray(DEFAULT_USERID_DATA);
|
|
@@ -812,7 +813,12 @@ describe('IndexexchangeAdapter', function () {
|
|
|
812
813
|
uids: [{
|
|
813
814
|
id: DEFAULT_USERID_DATA.imuid,
|
|
814
815
|
}]
|
|
815
|
-
}
|
|
816
|
+
}, {
|
|
817
|
+
source: '33across.com',
|
|
818
|
+
uids: [{
|
|
819
|
+
id: DEFAULT_USERID_DATA['33acrossId'].envelope
|
|
820
|
+
}]
|
|
821
|
+
},
|
|
816
822
|
];
|
|
817
823
|
|
|
818
824
|
const DEFAULT_USERID_BID_DATA = {
|
|
@@ -1204,7 +1210,7 @@ describe('IndexexchangeAdapter', function () {
|
|
|
1204
1210
|
const payload = extractPayload(request[0]);
|
|
1205
1211
|
expect(request).to.be.an('array');
|
|
1206
1212
|
expect(request).to.have.lengthOf.above(0); // should be 1 or more
|
|
1207
|
-
expect(payload.user.eids).to.have.lengthOf(
|
|
1213
|
+
expect(payload.user.eids).to.have.lengthOf(8);
|
|
1208
1214
|
expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
|
|
1209
1215
|
});
|
|
1210
1216
|
});
|
|
@@ -1392,7 +1398,7 @@ describe('IndexexchangeAdapter', function () {
|
|
|
1392
1398
|
cloneValidBid[0].userIdAsEids = utils.deepClone(DEFAULT_USERIDASEIDS_DATA);
|
|
1393
1399
|
const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
|
|
1394
1400
|
const payload = extractPayload(request);
|
|
1395
|
-
expect(payload.user.eids).to.have.lengthOf(
|
|
1401
|
+
expect(payload.user.eids).to.have.lengthOf(8);
|
|
1396
1402
|
expect(payload.user.eids).to.have.deep.members(DEFAULT_USERID_PAYLOAD);
|
|
1397
1403
|
});
|
|
1398
1404
|
|
|
@@ -1525,7 +1531,7 @@ describe('IndexexchangeAdapter', function () {
|
|
|
1525
1531
|
})
|
|
1526
1532
|
|
|
1527
1533
|
expect(payload.user).to.exist;
|
|
1528
|
-
expect(payload.user.eids).to.have.lengthOf(
|
|
1534
|
+
expect(payload.user.eids).to.have.lengthOf(10);
|
|
1529
1535
|
|
|
1530
1536
|
expect(payload.user.eids).to.have.deep.members(validUserIdPayload);
|
|
1531
1537
|
});
|
|
@@ -1567,7 +1573,7 @@ describe('IndexexchangeAdapter', function () {
|
|
|
1567
1573
|
});
|
|
1568
1574
|
|
|
1569
1575
|
const payload = extractPayload(request);
|
|
1570
|
-
expect(payload.user.eids).to.have.lengthOf(
|
|
1576
|
+
expect(payload.user.eids).to.have.lengthOf(9);
|
|
1571
1577
|
expect(payload.user.eids).to.have.deep.members(validUserIdPayload);
|
|
1572
1578
|
});
|
|
1573
1579
|
});
|
|
@@ -251,6 +251,11 @@ describe('LiveIntentMinimalId', function() {
|
|
|
251
251
|
expect(result).to.eql({'uid2': {'id': 'bar'}});
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
+
it('should decode a magnite id to a seperate object when present', function() {
|
|
255
|
+
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', magnite: 'bar' });
|
|
256
|
+
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar'}});
|
|
257
|
+
});
|
|
258
|
+
|
|
254
259
|
it('should allow disabling nonId resolution', function() {
|
|
255
260
|
let callBackSpy = sinon.spy();
|
|
256
261
|
let submoduleCallback = liveIntentIdSubmodule.getId({ params: {
|
|
@@ -368,6 +368,11 @@ describe('LiveIntentId', function() {
|
|
|
368
368
|
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'medianet': 'bar'}, 'medianet': {'id': 'bar'}});
|
|
369
369
|
});
|
|
370
370
|
|
|
371
|
+
it('should decode a magnite id to a seperate object when present', function() {
|
|
372
|
+
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', magnite: 'bar' });
|
|
373
|
+
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar'}});
|
|
374
|
+
});
|
|
375
|
+
|
|
371
376
|
it('should decode values with uid2 but no nonId', function() {
|
|
372
377
|
const result = liveIntentIdSubmodule.decode({ uid2: 'bar' });
|
|
373
378
|
expect(result).to.eql({'uid2': {'id': 'bar'}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { spec } from 'modules/optidigitalBidAdapter.js';
|
|
2
|
+
import { spec, resetSync } from 'modules/optidigitalBidAdapter.js';
|
|
3
3
|
import * as utils from 'src/utils.js';
|
|
4
4
|
|
|
5
5
|
const ENDPOINT = 'https://pbs.optidigital.com/bidder';
|
|
@@ -497,6 +497,7 @@ describe('optidigitalAdapterTests', function () {
|
|
|
497
497
|
let test;
|
|
498
498
|
beforeEach(function () {
|
|
499
499
|
test = sinon.sandbox.create();
|
|
500
|
+
resetSync();
|
|
500
501
|
});
|
|
501
502
|
afterEach(function() {
|
|
502
503
|
test.restore();
|
|
@@ -508,16 +509,22 @@ describe('optidigitalAdapterTests', function () {
|
|
|
508
509
|
}]);
|
|
509
510
|
});
|
|
510
511
|
|
|
511
|
-
it('should return appropriate URL', function() {
|
|
512
|
+
it('should return appropriate URL with GDPR equals to 1 and GDPR consent', function() {
|
|
512
513
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, undefined)).to.deep.equal([{
|
|
513
514
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo`
|
|
514
515
|
}]);
|
|
516
|
+
});
|
|
517
|
+
it('should return appropriate URL with GDPR equals to 0 and GDPR consent', function() {
|
|
515
518
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: false, consentString: 'foo'}, undefined)).to.deep.equal([{
|
|
516
519
|
type: 'iframe', url: `${syncurlIframe}&gdpr=0&gdpr_consent=foo`
|
|
517
520
|
}]);
|
|
521
|
+
});
|
|
522
|
+
it('should return appropriate URL with GDPR equals to 1 and no consent', function() {
|
|
518
523
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: undefined}, undefined)).to.deep.equal([{
|
|
519
524
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=`
|
|
520
525
|
}]);
|
|
526
|
+
});
|
|
527
|
+
it('should return appropriate URL with GDPR equals to 1, GDPR consent and CCPA consent', function() {
|
|
521
528
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, {consentString: 'fooUsp'})).to.deep.equal([{
|
|
522
529
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&ccpa_consent=fooUsp`
|
|
523
530
|
}]);
|
|
@@ -318,6 +318,41 @@ describe('RTBHouseAdapter', () => {
|
|
|
318
318
|
expect(request.method).to.equal('POST');
|
|
319
319
|
});
|
|
320
320
|
|
|
321
|
+
it('sets default fledgeConfig object values when none available from config', function () {
|
|
322
|
+
let bidRequest = Object.assign([], bidRequests);
|
|
323
|
+
delete bidRequest[0].params.test;
|
|
324
|
+
|
|
325
|
+
config.setConfig({ fledgeConfig: false });
|
|
326
|
+
const request = spec.buildRequests(bidRequest, { ...bidderRequest, fledgeEnabled: true });
|
|
327
|
+
const data = JSON.parse(request.data);
|
|
328
|
+
expect(data.ext).to.exist.and.to.be.a('object');
|
|
329
|
+
expect(data.ext.fledge_config).to.exist.and.to.be.a('object');
|
|
330
|
+
expect(data.ext.fledge_config).to.contain.keys('seller', 'decisionLogicUrl', 'sellerTimeout');
|
|
331
|
+
expect(data.ext.fledge_config.seller).to.equal('https://fledge-ssp.creativecdn.com');
|
|
332
|
+
expect(data.ext.fledge_config.decisionLogicUrl).to.equal('https://fledge-ssp.creativecdn.com/component-seller-prebid.js');
|
|
333
|
+
expect(data.ext.fledge_config.sellerTimeout).to.equal(500);
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
it('sets a fledgeConfig object values when available from config', function () {
|
|
337
|
+
let bidRequest = Object.assign([], bidRequests);
|
|
338
|
+
delete bidRequest[0].params.test;
|
|
339
|
+
|
|
340
|
+
config.setConfig({
|
|
341
|
+
fledgeConfig: {
|
|
342
|
+
seller: 'https://sellers.domain',
|
|
343
|
+
decisionLogicUrl: 'https://sellers.domain/decision.url'
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
const request = spec.buildRequests(bidRequest, { ...bidderRequest, fledgeEnabled: true });
|
|
347
|
+
const data = JSON.parse(request.data);
|
|
348
|
+
expect(data.ext).to.exist.and.to.be.a('object');
|
|
349
|
+
expect(data.ext.fledge_config).to.exist.and.to.be.a('object');
|
|
350
|
+
expect(data.ext.fledge_config).to.contain.keys('seller', 'decisionLogicUrl');
|
|
351
|
+
expect(data.ext.fledge_config.seller).to.equal('https://sellers.domain');
|
|
352
|
+
expect(data.ext.fledge_config.decisionLogicUrl).to.equal('https://sellers.domain/decision.url');
|
|
353
|
+
expect(data.ext.fledge_config.sellerTimeout).to.not.exist;
|
|
354
|
+
});
|
|
355
|
+
|
|
321
356
|
it('when FLEDGE is disabled, should not send imp.ext.ae', function () {
|
|
322
357
|
let bidRequest = Object.assign([], bidRequests);
|
|
323
358
|
delete bidRequest[0].params.test;
|
|
@@ -20,6 +20,7 @@ const makeBidRequest = function (overrides) {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const BASE_BIDDER_REQUEST = {
|
|
23
|
+
auctionId: 'test',
|
|
23
24
|
bidderRequestId: 'test',
|
|
24
25
|
refererInfo: {
|
|
25
26
|
canonicalUrl: 'https://localhost',
|
|
@@ -53,8 +54,8 @@ describe('snigelBidAdapter', function () {
|
|
|
53
54
|
it('should build a single request for every impression and its placement', function () {
|
|
54
55
|
const bidderRequest = Object.assign({}, BASE_BIDDER_REQUEST);
|
|
55
56
|
const bidRequests = [
|
|
56
|
-
makeBidRequest({bidId: 'a', params: {placement: 'top_leaderboard'}}),
|
|
57
|
-
makeBidRequest({bidId: 'b', params: {placement: 'bottom_leaderboard'}}),
|
|
57
|
+
makeBidRequest({bidId: 'a', adUnitCode: 'au_a', params: {placement: 'top_leaderboard'}}),
|
|
58
|
+
makeBidRequest({bidId: 'b', adUnitCode: 'au_b', params: {placement: 'bottom_leaderboard'}}),
|
|
58
59
|
];
|
|
59
60
|
|
|
60
61
|
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
@@ -70,9 +71,9 @@ describe('snigelBidAdapter', function () {
|
|
|
70
71
|
expect(data).to.have.property('page').and.to.equal('https://localhost');
|
|
71
72
|
expect(data).to.have.property('placements');
|
|
72
73
|
expect(data.placements.length).to.equal(2);
|
|
73
|
-
expect(data.placements[0].
|
|
74
|
+
expect(data.placements[0].id).to.equal('au_a');
|
|
74
75
|
expect(data.placements[0].name).to.equal('top_leaderboard');
|
|
75
|
-
expect(data.placements[1].
|
|
76
|
+
expect(data.placements[1].id).to.equal('au_b');
|
|
76
77
|
expect(data.placements[1].name).to.equal('bottom_leaderboard');
|
|
77
78
|
});
|
|
78
79
|
|
|
@@ -127,6 +128,56 @@ describe('snigelBidAdapter', function () {
|
|
|
127
128
|
const data = JSON.parse(request.data);
|
|
128
129
|
expect(data).to.have.property('coppa').and.to.equal(true);
|
|
129
130
|
});
|
|
131
|
+
|
|
132
|
+
it('should forward refresh information', function () {
|
|
133
|
+
const bidderRequest = Object.assign({}, BASE_BIDDER_REQUEST);
|
|
134
|
+
const topLeaderboard = makeBidRequest({adUnitCode: 'top_leaderboard'});
|
|
135
|
+
const bottomLeaderboard = makeBidRequest({adUnitCode: 'bottom_leaderboard'});
|
|
136
|
+
const sidebar = makeBidRequest({adUnitCode: 'sidebar'});
|
|
137
|
+
|
|
138
|
+
// first auction, no refresh
|
|
139
|
+
let request = spec.buildRequests([topLeaderboard, bottomLeaderboard], bidderRequest);
|
|
140
|
+
expect(request).to.have.property('data');
|
|
141
|
+
let data = JSON.parse(request.data);
|
|
142
|
+
expect(data).to.have.property('placements');
|
|
143
|
+
expect(data.placements.length).to.equal(2);
|
|
144
|
+
expect(data.placements[0].id).to.equal('top_leaderboard');
|
|
145
|
+
expect(data.placements[0].refresh).to.be.undefined;
|
|
146
|
+
expect(data.placements[1].id).to.equal('bottom_leaderboard');
|
|
147
|
+
expect(data.placements[1].refresh).to.be.undefined;
|
|
148
|
+
|
|
149
|
+
// second auction for top leaderboard, was refreshed
|
|
150
|
+
request = spec.buildRequests([topLeaderboard, sidebar], bidderRequest);
|
|
151
|
+
expect(request).to.have.property('data');
|
|
152
|
+
data = JSON.parse(request.data);
|
|
153
|
+
expect(data).to.have.property('placements');
|
|
154
|
+
expect(data.placements.length).to.equal(2);
|
|
155
|
+
expect(data.placements[0].id).to.equal('top_leaderboard');
|
|
156
|
+
expect(data.placements[0].refresh).to.not.be.undefined;
|
|
157
|
+
expect(data.placements[0].refresh.count).to.equal(1);
|
|
158
|
+
expect(data.placements[0].refresh.time).to.be.greaterThanOrEqual(0);
|
|
159
|
+
expect(data.placements[1].id).to.equal('sidebar');
|
|
160
|
+
expect(data.placements[1].refresh).to.be.undefined;
|
|
161
|
+
|
|
162
|
+
// third auction, all units refreshed at some point
|
|
163
|
+
request = spec.buildRequests([topLeaderboard, bottomLeaderboard, sidebar], bidderRequest);
|
|
164
|
+
expect(request).to.have.property('data');
|
|
165
|
+
data = JSON.parse(request.data);
|
|
166
|
+
expect(data).to.have.property('placements');
|
|
167
|
+
expect(data.placements.length).to.equal(3);
|
|
168
|
+
expect(data.placements[0].id).to.equal('top_leaderboard');
|
|
169
|
+
expect(data.placements[0].refresh).to.not.be.undefined;
|
|
170
|
+
expect(data.placements[0].refresh.count).to.equal(2);
|
|
171
|
+
expect(data.placements[0].refresh.time).to.be.greaterThanOrEqual(0);
|
|
172
|
+
expect(data.placements[1].id).to.equal('bottom_leaderboard');
|
|
173
|
+
expect(data.placements[1].refresh).to.not.be.undefined;
|
|
174
|
+
expect(data.placements[1].refresh.count).to.equal(1);
|
|
175
|
+
expect(data.placements[1].refresh.time).to.be.greaterThanOrEqual(0);
|
|
176
|
+
expect(data.placements[2].id).to.equal('sidebar');
|
|
177
|
+
expect(data.placements[2].refresh).to.not.be.undefined;
|
|
178
|
+
expect(data.placements[2].refresh.count).to.equal(1);
|
|
179
|
+
expect(data.placements[2].refresh.time).to.be.greaterThanOrEqual(0);
|
|
180
|
+
});
|
|
130
181
|
});
|
|
131
182
|
|
|
132
183
|
describe('interpretResponse', function () {
|
|
@@ -146,7 +197,7 @@ describe('snigelBidAdapter', function () {
|
|
|
146
197
|
cur: 'USD',
|
|
147
198
|
bids: [
|
|
148
199
|
{
|
|
149
|
-
|
|
200
|
+
id: BASE_BID_REQUEST.adUnitCode,
|
|
150
201
|
price: 0.0575,
|
|
151
202
|
ad: '<html><body><h1>Test Ad</h1></body></html>',
|
|
152
203
|
width: 728,
|
|
@@ -160,7 +211,7 @@ describe('snigelBidAdapter', function () {
|
|
|
160
211
|
},
|
|
161
212
|
};
|
|
162
213
|
|
|
163
|
-
const bids = spec.interpretResponse(serverResponse, {});
|
|
214
|
+
const bids = spec.interpretResponse(serverResponse, {bidderRequest: {bids: [BASE_BID_REQUEST]}});
|
|
164
215
|
expect(bids.length).to.equal(1);
|
|
165
216
|
const bid = bids[0];
|
|
166
217
|
expect(isValid(BASE_BID_REQUEST.adUnitCode, bid)).to.be.true;
|