prebid.js 8.2.0 → 8.4.0
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/admanBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtelligentBidAdapter.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/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridBidAdapter.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/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/dependencies.json +6 -0
- package/dist/discoveryBidAdapter.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/gdprEnforcement.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/holidBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.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/livewrappedAnalyticsAdapter.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/mediagoBidAdapter.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 +143 -143
- 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 +2 -2
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pulsepointBidAdapter.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/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharedIdSystem.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/smartyadsBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.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/stroeerCoreBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/topicsFpdModule.js +1 -1
- package/dist/trafficgateBidAdapter.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/voxBidAdapter.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/yandexBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +1 -1
- package/integrationExamples/videoModule/jwplayer/eventListeners.html +2 -2
- package/integrationExamples/videoModule/jwplayer/eventsUI.html +1 -1
- package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +1 -1
- package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +1 -1
- package/integrationExamples/videoModule/jwplayer/playlist.html +1 -1
- package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +1 -1
- package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +1 -1
- package/integrationExamples/videoModule/videojs/eventListeners.html +1 -1
- package/integrationExamples/videoModule/videojs/eventsUI.html +1 -1
- package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +1 -1
- package/integrationExamples/videoModule/videojs/mediaMetadata.html +1 -1
- package/integrationExamples/videoModule/videojs/playlist.html +1 -1
- package/modules/33acrossBidAdapter.js +24 -14
- package/modules/33acrossIdSystem.js +15 -4
- package/modules/adagioBidAdapter.js +2 -2
- package/modules/admanBidAdapter.js +4 -0
- package/modules/adtelligentBidAdapter.js +8 -0
- package/modules/beopBidAdapter.js +6 -6
- package/modules/beopBidAdapter.md +35 -1
- package/modules/brandmetricsRtdProvider.js +36 -2
- package/modules/brandmetricsRtdProvider.md +17 -2
- package/modules/cadentApertureMXBidAdapter.md +2 -2
- package/modules/discoveryBidAdapter.js +1 -1
- package/modules/gdprEnforcement.js +27 -22
- package/modules/gridBidAdapter.js +19 -0
- package/modules/holidBidAdapter.js +49 -30
- package/modules/ixBidAdapter.js +41 -2
- package/modules/kargoBidAdapter.js +4 -0
- package/modules/livewrappedAnalyticsAdapter.js +33 -33
- package/modules/mediagoBidAdapter.js +1 -0
- package/modules/minutemediaBidAdapter.js +17 -2
- package/modules/oguryBidAdapter.js +29 -16
- package/modules/pubmaticBidAdapter.js +16 -1
- package/modules/pulsepointBidAdapter.js +63 -424
- package/modules/pulsepointBidAdapter.md +39 -45
- package/modules/sharedIdSystem.js +1 -1
- package/modules/smartyadsBidAdapter.js +6 -3
- package/modules/sovrnBidAdapter.js +10 -1
- package/modules/stroeerCoreBidAdapter.js +2 -3
- package/modules/teadsBidAdapter.js +2 -0
- package/modules/topicsFpdModule.js +4 -1
- package/modules/topicsFpdModule.md +4 -0
- package/modules/trafficgateBidAdapter.js +126 -72
- package/modules/userId/index.js +2 -2
- package/modules/vidazooBidAdapter.js +69 -19
- package/modules/voxBidAdapter.js +16 -5
- package/modules/yahoosspBidAdapter.js +38 -33
- package/modules/yahoosspBidAdapter.md +96 -95
- package/modules/yandexBidAdapter.js +12 -15
- package/package.json +1 -1
- package/src/activities/redactor.js +1 -1
- package/src/auction.js +24 -2
- package/src/constants.json +3 -1
- package/src/fpd/sua.js +8 -2
- package/test/spec/auctionmanager_spec.js +29 -1
- package/test/spec/fpd/enrichment_spec.js +7 -1
- package/test/spec/fpd/sua_spec.js +12 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +188 -35
- package/test/spec/modules/33acrossIdSystem_spec.js +122 -27
- package/test/spec/modules/adagioBidAdapter_spec.js +2 -2
- package/test/spec/modules/adtelligentBidAdapter_spec.js +8 -0
- package/test/spec/modules/beopBidAdapter_spec.js +18 -2
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +69 -7
- package/test/spec/modules/cadentApertureMXBidAdapter_spec.js +1 -1
- package/test/spec/modules/gdprEnforcement_spec.js +43 -2
- package/test/spec/modules/gridBidAdapter_spec.js +42 -0
- package/test/spec/modules/holidBidAdapter_spec.js +26 -6
- package/test/spec/modules/ixBidAdapter_spec.js +84 -6
- package/test/spec/modules/kargoBidAdapter_spec.js +121 -106
- package/test/spec/modules/minutemediaBidAdapter_spec.js +36 -5
- package/test/spec/modules/oguryBidAdapter_spec.js +208 -108
- package/test/spec/modules/pubmaticBidAdapter_spec.js +119 -0
- package/test/spec/modules/pulsepointBidAdapter_spec.js +225 -486
- package/test/spec/modules/smartyadsBidAdapter_spec.js +1 -1
- package/test/spec/modules/sovrnBidAdapter_spec.js +58 -4
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +8 -5
- package/test/spec/modules/teadsBidAdapter_spec.js +70 -21
- package/test/spec/modules/topicsFpdModule_spec.js +10 -4
- package/test/spec/modules/trafficgateBidAdapter_spec.js +1349 -199
- package/test/spec/modules/vidazooBidAdapter_spec.js +130 -4
- package/test/spec/modules/voxBidAdapter_spec.js +93 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +402 -314
- package/test/spec/modules/yandexBidAdapter_spec.js +21 -3
- package/integrationExamples/gpt/inskin_example.html +0 -100
|
@@ -40,7 +40,6 @@ const BID = {
|
|
|
40
40
|
'placementCode': 'div-gpt-ad-1460505748561-0',
|
|
41
41
|
'sizes': [[300, 250], [300, 600]],
|
|
42
42
|
'bidderRequestId': '1fdb5ff1b6eaa7',
|
|
43
|
-
'auctionId': 'auction_id',
|
|
44
43
|
'bidRequestsCount': 4,
|
|
45
44
|
'bidderRequestsCount': 3,
|
|
46
45
|
'bidderWinsCount': 1,
|
|
@@ -64,7 +63,6 @@ const VIDEO_BID = {
|
|
|
64
63
|
tid: '56e184c6-bde9-497b-b9b9-cf47a61381ee',
|
|
65
64
|
}
|
|
66
65
|
},
|
|
67
|
-
'auctionId': 'auction_id',
|
|
68
66
|
'bidRequestsCount': 4,
|
|
69
67
|
'bidderRequestsCount': 3,
|
|
70
68
|
'bidderWinsCount': 1,
|
|
@@ -142,6 +140,7 @@ const SERVER_RESPONSE = {
|
|
|
142
140
|
cid: 'testcid123',
|
|
143
141
|
results: [{
|
|
144
142
|
'ad': '<iframe>console.log("hello world")</iframe>',
|
|
143
|
+
'bidId': '2d52001cabd527-response',
|
|
145
144
|
'price': 0.8,
|
|
146
145
|
'creativeId': '12610997325162499419',
|
|
147
146
|
'exp': 30,
|
|
@@ -287,7 +286,6 @@ describe('VidazooBidAdapter', function () {
|
|
|
287
286
|
usPrivacy: 'consent_string',
|
|
288
287
|
gppString: 'gpp_string',
|
|
289
288
|
gppSid: [7],
|
|
290
|
-
auctionId: 'auction_id',
|
|
291
289
|
bidRequestsCount: 4,
|
|
292
290
|
bidderRequestsCount: 3,
|
|
293
291
|
bidderWinsCount: 1,
|
|
@@ -361,7 +359,6 @@ describe('VidazooBidAdapter', function () {
|
|
|
361
359
|
usPrivacy: 'consent_string',
|
|
362
360
|
gppString: 'gpp_string',
|
|
363
361
|
gppSid: [7],
|
|
364
|
-
auctionId: 'auction_id',
|
|
365
362
|
bidRequestsCount: 4,
|
|
366
363
|
bidderRequestsCount: 3,
|
|
367
364
|
bidderWinsCount: 1,
|
|
@@ -413,8 +410,122 @@ describe('VidazooBidAdapter', function () {
|
|
|
413
410
|
});
|
|
414
411
|
});
|
|
415
412
|
|
|
413
|
+
it('should build single banner request for multiple bids', function () {
|
|
414
|
+
config.setConfig({
|
|
415
|
+
bidderTimeout: 3000,
|
|
416
|
+
vidazoo: {
|
|
417
|
+
singleRequest: true,
|
|
418
|
+
chunkSize: 2
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
|
|
423
|
+
|
|
424
|
+
const BID2 = utils.deepClone(BID);
|
|
425
|
+
BID2.bidId = '2d52001cabd528';
|
|
426
|
+
BID2.adUnitCode = 'div-gpt-ad-12345-1';
|
|
427
|
+
BID2.sizes = [[300, 250]];
|
|
428
|
+
|
|
429
|
+
const REQUEST_DATA = {
|
|
430
|
+
gdprConsent: 'consent_string',
|
|
431
|
+
gdpr: 1,
|
|
432
|
+
usPrivacy: 'consent_string',
|
|
433
|
+
gppString: 'gpp_string',
|
|
434
|
+
gppSid: [7],
|
|
435
|
+
bidRequestsCount: 4,
|
|
436
|
+
bidderRequestsCount: 3,
|
|
437
|
+
bidderWinsCount: 1,
|
|
438
|
+
bidderTimeout: 3000,
|
|
439
|
+
transactionId: 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
|
|
440
|
+
bidderRequestId: '1fdb5ff1b6eaa7',
|
|
441
|
+
sizes: ['300x250', '300x600'],
|
|
442
|
+
sua: {
|
|
443
|
+
'source': 2,
|
|
444
|
+
'platform': {
|
|
445
|
+
'brand': 'Android',
|
|
446
|
+
'version': ['8', '0', '0']
|
|
447
|
+
},
|
|
448
|
+
'browsers': [
|
|
449
|
+
{'brand': 'Not_A Brand', 'version': ['99', '0', '0', '0']},
|
|
450
|
+
{'brand': 'Google Chrome', 'version': ['109', '0', '5414', '119']},
|
|
451
|
+
{'brand': 'Chromium', 'version': ['109', '0', '5414', '119']}
|
|
452
|
+
],
|
|
453
|
+
'mobile': 1,
|
|
454
|
+
'model': 'SM-G955U',
|
|
455
|
+
'bitness': '64',
|
|
456
|
+
'architecture': ''
|
|
457
|
+
},
|
|
458
|
+
url: 'https%3A%2F%2Fwww.greatsite.com',
|
|
459
|
+
referrer: 'https://www.somereferrer.com',
|
|
460
|
+
cb: 1000,
|
|
461
|
+
bidFloor: 0.1,
|
|
462
|
+
bidId: '2d52001cabd527',
|
|
463
|
+
adUnitCode: 'div-gpt-ad-12345-0',
|
|
464
|
+
publisherId: '59ac17c192832d0011283fe3',
|
|
465
|
+
dealId: 3,
|
|
466
|
+
sessionId: '',
|
|
467
|
+
uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
|
|
468
|
+
bidderVersion: adapter.version,
|
|
469
|
+
prebidVersion: version,
|
|
470
|
+
schain: BID.schain,
|
|
471
|
+
ptrace: '1000',
|
|
472
|
+
res: `${window.top.screen.width}x${window.top.screen.height}`,
|
|
473
|
+
mediaTypes: [BANNER],
|
|
474
|
+
uqs: getTopWindowQueryParams(),
|
|
475
|
+
'ext.param1': 'loremipsum',
|
|
476
|
+
'ext.param2': 'dolorsitamet',
|
|
477
|
+
isStorageAllowed: true,
|
|
478
|
+
gpid: '1234567890',
|
|
479
|
+
cat: ['IAB2'],
|
|
480
|
+
pagecat: ['IAB2-2'],
|
|
481
|
+
webSessionId: webSessionId
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
const REQUEST_DATA2 = utils.deepClone(REQUEST_DATA);
|
|
485
|
+
REQUEST_DATA2.bidId = '2d52001cabd528';
|
|
486
|
+
REQUEST_DATA2.adUnitCode = 'div-gpt-ad-12345-1';
|
|
487
|
+
REQUEST_DATA2.sizes = ['300x250'];
|
|
488
|
+
REQUEST_DATA2.dealId = 4;
|
|
489
|
+
|
|
490
|
+
const requests = adapter.buildRequests([BID, BID2], BIDDER_REQUEST);
|
|
491
|
+
expect(requests).to.have.length(1);
|
|
492
|
+
|
|
493
|
+
expect(requests[0]).to.deep.equal({
|
|
494
|
+
method: 'POST',
|
|
495
|
+
url: `${createDomain(SUB_DOMAIN)}/prebid/multi/59db6b3b4ffaa70004f45cdc`,
|
|
496
|
+
data: {bids: [REQUEST_DATA, REQUEST_DATA2]}
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
it('should return seperated requests for video and banner if singleRequest is true', function () {
|
|
501
|
+
config.setConfig({
|
|
502
|
+
bidderTimeout: 3000,
|
|
503
|
+
vidazoo: {
|
|
504
|
+
singleRequest: true,
|
|
505
|
+
chunkSize: 2
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
const requests = adapter.buildRequests([BID, VIDEO_BID], BIDDER_REQUEST);
|
|
510
|
+
expect(requests).to.have.length(2);
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
it('should chunk requests if requests exceed chunkSize and singleRequest is true', function () {
|
|
514
|
+
config.setConfig({
|
|
515
|
+
bidderTimeout: 3000,
|
|
516
|
+
vidazoo: {
|
|
517
|
+
singleRequest: true,
|
|
518
|
+
chunkSize: 2
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
const requests = adapter.buildRequests([BID, BID, BID, BID], BIDDER_REQUEST);
|
|
523
|
+
expect(requests).to.have.length(2);
|
|
524
|
+
});
|
|
525
|
+
|
|
416
526
|
after(function () {
|
|
417
527
|
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
528
|
+
config.resetConfig();
|
|
418
529
|
sandbox.restore();
|
|
419
530
|
});
|
|
420
531
|
});
|
|
@@ -515,6 +626,21 @@ describe('VidazooBidAdapter', function () {
|
|
|
515
626
|
});
|
|
516
627
|
});
|
|
517
628
|
|
|
629
|
+
it('should populate requestId from response in case of singleRequest true', function () {
|
|
630
|
+
config.setConfig({
|
|
631
|
+
vidazoo: {
|
|
632
|
+
singleRequest: true,
|
|
633
|
+
chunkSize: 2
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
const responses = adapter.interpretResponse(SERVER_RESPONSE, REQUEST);
|
|
638
|
+
expect(responses).to.have.length(1);
|
|
639
|
+
expect(responses[0].requestId).to.equal('2d52001cabd527-response');
|
|
640
|
+
|
|
641
|
+
config.resetConfig();
|
|
642
|
+
});
|
|
643
|
+
|
|
518
644
|
it('should take default TTL', function () {
|
|
519
645
|
const serverResponse = utils.deepClone(SERVER_RESPONSE);
|
|
520
646
|
delete serverResponse.body.results[0].exp;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { expect } from 'chai'
|
|
2
2
|
import { spec } from 'modules/voxBidAdapter.js'
|
|
3
|
+
import {config} from 'src/config.js'
|
|
3
4
|
|
|
4
5
|
function getSlotConfigs(mediaTypes, params) {
|
|
5
6
|
return {
|
|
@@ -175,6 +176,98 @@ describe('VOX Adapter', function() {
|
|
|
175
176
|
expect(bid.transactionId).to.equal('31a58515-3634-4e90-9c96-f86196db1459')
|
|
176
177
|
})
|
|
177
178
|
})
|
|
179
|
+
it('should not set userid if not specified', function () {
|
|
180
|
+
const request = spec.buildRequests(validBidRequests, bidderRequest)
|
|
181
|
+
const data = JSON.parse(request.data)
|
|
182
|
+
data.bidRequests.forEach(bid => {
|
|
183
|
+
expect(bid.userId).to.be.undefined
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
it('should set userid if specified', function () {
|
|
188
|
+
const requests = validBidRequests.map(bid => ({
|
|
189
|
+
...bid,
|
|
190
|
+
userId: {
|
|
191
|
+
tdid: 'TDID_USER_ID',
|
|
192
|
+
pubcid: 'PUBID_USER_ID'
|
|
193
|
+
}
|
|
194
|
+
}))
|
|
195
|
+
const request = spec.buildRequests(requests, bidderRequest)
|
|
196
|
+
const data = JSON.parse(request.data)
|
|
197
|
+
data.bidRequests.forEach(bid => {
|
|
198
|
+
expect(bid.userId.tdid).to.equal('TDID_USER_ID')
|
|
199
|
+
expect(bid.userId.pubcid).to.equal('PUBID_USER_ID')
|
|
200
|
+
})
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
it('should not set schain if not specified', function () {
|
|
204
|
+
const request = spec.buildRequests(validBidRequests, bidderRequest)
|
|
205
|
+
const data = JSON.parse(request.data)
|
|
206
|
+
data.bidRequests.forEach(bid => {
|
|
207
|
+
expect(bid.schain).to.be.undefined
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
it('should set schain if not specified', function () {
|
|
212
|
+
const requests = validBidRequests.map(bid => ({
|
|
213
|
+
...bid,
|
|
214
|
+
schain: {
|
|
215
|
+
validation: 'strict',
|
|
216
|
+
config: {
|
|
217
|
+
ver: '1.0'
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}))
|
|
221
|
+
const request = spec.buildRequests(requests, bidderRequest)
|
|
222
|
+
const data = JSON.parse(request.data)
|
|
223
|
+
data.bidRequests.forEach(bid => {
|
|
224
|
+
expect(bid.schain.validation).to.equal('strict')
|
|
225
|
+
expect(bid.schain.config.ver).to.equal('1.0')
|
|
226
|
+
})
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
describe('price floors', function () {
|
|
230
|
+
it('should be empty if floors module not configured', function () {
|
|
231
|
+
const request = spec.buildRequests(validBidRequests, bidderRequest)
|
|
232
|
+
const data = JSON.parse(request.data)
|
|
233
|
+
data.bidRequests.forEach(bid => {
|
|
234
|
+
expect(bid.floorInfo).to.be.empty
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
it('should add correct floor values', function () {
|
|
239
|
+
const expectedFloors = [ 2, 2.7, 1.4 ]
|
|
240
|
+
const validBidRequests = expectedFloors.map(getBidWithFloor)
|
|
241
|
+
const request = spec.buildRequests(validBidRequests, bidderRequest)
|
|
242
|
+
const data = JSON.parse(request.data)
|
|
243
|
+
expectedFloors.forEach((floor, index) => {
|
|
244
|
+
expect(data.bidRequests[index].floorInfo.floor).to.equal(floor)
|
|
245
|
+
expect(data.bidRequests[index].floorInfo.currency).to.equal('USD')
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
it('should request floor price in adserver currency', function () {
|
|
250
|
+
const configCurrency = 'DKK'
|
|
251
|
+
config.setConfig({ currency: { adServerCurrency: configCurrency } })
|
|
252
|
+
const request = spec.buildRequests([ getBidWithFloor() ], bidderRequest)
|
|
253
|
+
const data = JSON.parse(request.data)
|
|
254
|
+
data.bidRequests.forEach(bid => {
|
|
255
|
+
expect(bid.floorInfo.currency).to.equal(configCurrency)
|
|
256
|
+
})
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
function getBidWithFloor(floor) {
|
|
260
|
+
return {
|
|
261
|
+
...validBidRequests[0],
|
|
262
|
+
getFloor: ({ currency }) => {
|
|
263
|
+
return {
|
|
264
|
+
currency: currency,
|
|
265
|
+
floor
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
})
|
|
178
271
|
|
|
179
272
|
describe('GDPR params', function() {
|
|
180
273
|
describe('when there are not consent management platform', function() {
|