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.
Files changed (227) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/admanBidAdapter.js +1 -1
  7. package/dist/adqueryBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adtelligentBidAdapter.js +1 -1
  10. package/dist/adtrgtmeBidAdapter.js +1 -1
  11. package/dist/adxcgBidAdapter.js +1 -1
  12. package/dist/adyoulikeBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/beopBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/brandmetricsRtdProvider.js +1 -1
  24. package/dist/bridBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/carodaBidAdapter.js +1 -1
  28. package/dist/chtnwBidAdapter.js +1 -1
  29. package/dist/concertBidAdapter.js +1 -1
  30. package/dist/connectadBidAdapter.js +1 -1
  31. package/dist/consumableBidAdapter.js +1 -1
  32. package/dist/conversantAnalyticsAdapter.js +1 -1
  33. package/dist/conversantBidAdapter.js +1 -1
  34. package/dist/craftBidAdapter.js +1 -1
  35. package/dist/criteoBidAdapter.js +1 -1
  36. package/dist/cwireBidAdapter.js +1 -1
  37. package/dist/dependencies.json +6 -0
  38. package/dist/discoveryBidAdapter.js +1 -1
  39. package/dist/dspxBidAdapter.js +1 -1
  40. package/dist/eplanningBidAdapter.js +1 -1
  41. package/dist/euidIdSystem.js +1 -1
  42. package/dist/feedadBidAdapter.js +1 -1
  43. package/dist/finativeBidAdapter.js +1 -1
  44. package/dist/freewheel-sspBidAdapter.js +1 -1
  45. package/dist/gdprEnforcement.js +1 -1
  46. package/dist/gmosspBidAdapter.js +1 -1
  47. package/dist/goldbachBidAdapter.js +1 -1
  48. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  49. package/dist/greenbidsRtdProvider.js +1 -1
  50. package/dist/gridBidAdapter.js +1 -1
  51. package/dist/gumgumBidAdapter.js +1 -1
  52. package/dist/h12mediaBidAdapter.js +1 -1
  53. package/dist/holidBidAdapter.js +1 -1
  54. package/dist/hypelabBidAdapter.js +1 -1
  55. package/dist/id5IdSystem.js +1 -1
  56. package/dist/imdsBidAdapter.js +1 -1
  57. package/dist/improvedigitalBidAdapter.js +1 -1
  58. package/dist/insticatorBidAdapter.js +1 -1
  59. package/dist/ixBidAdapter.js +1 -1
  60. package/dist/justpremiumBidAdapter.js +1 -1
  61. package/dist/kargoBidAdapter.js +1 -1
  62. package/dist/konduitAnalyticsAdapter.js +1 -1
  63. package/dist/kueezBidAdapter.js +1 -1
  64. package/dist/kueezRtbBidAdapter.js +1 -1
  65. package/dist/kulturemediaBidAdapter.js +1 -1
  66. package/dist/lassoBidAdapter.js +1 -1
  67. package/dist/lifestreetBidAdapter.js +1 -1
  68. package/dist/livewrappedAnalyticsAdapter.js +1 -1
  69. package/dist/logicadBidAdapter.js +1 -1
  70. package/dist/loglyliftBidAdapter.js +1 -1
  71. package/dist/magniteAnalyticsAdapter.js +1 -1
  72. package/dist/malltvAnalyticsAdapter.js +1 -1
  73. package/dist/marsmediaBidAdapter.js +1 -1
  74. package/dist/mediafuseBidAdapter.js +1 -1
  75. package/dist/mediagoBidAdapter.js +1 -1
  76. package/dist/mediasquareBidAdapter.js +1 -1
  77. package/dist/mgidBidAdapter.js +1 -1
  78. package/dist/minutemediaBidAdapter.js +1 -1
  79. package/dist/minutemediaplusBidAdapter.js +1 -1
  80. package/dist/nexx360BidAdapter.js +1 -1
  81. package/dist/not-for-prod/prebid.js +143 -143
  82. package/dist/oguryBidAdapter.js +1 -1
  83. package/dist/onetagBidAdapter.js +1 -1
  84. package/dist/ooloAnalyticsAdapter.js +1 -1
  85. package/dist/optidigitalBidAdapter.js +1 -1
  86. package/dist/outbrainBidAdapter.js +1 -1
  87. package/dist/parrableIdSystem.js +1 -1
  88. package/dist/pixfutureBidAdapter.js +1 -1
  89. package/dist/prebid-core.js +2 -2
  90. package/dist/publinkIdSystem.js +1 -1
  91. package/dist/pubmaticBidAdapter.js +1 -1
  92. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  93. package/dist/pulsepointBidAdapter.js +1 -1
  94. package/dist/pxyzBidAdapter.js +1 -1
  95. package/dist/quantcastBidAdapter.js +1 -1
  96. package/dist/readpeakBidAdapter.js +1 -1
  97. package/dist/relaidoBidAdapter.js +1 -1
  98. package/dist/retailspotBidAdapter.js +1 -1
  99. package/dist/rhythmoneBidAdapter.js +1 -1
  100. package/dist/riseBidAdapter.js +1 -1
  101. package/dist/rubiconBidAdapter.js +1 -1
  102. package/dist/seedingAllianceBidAdapter.js +1 -1
  103. package/dist/seedtagBidAdapter.js +1 -1
  104. package/dist/sharedIdSystem.js +1 -1
  105. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  106. package/dist/sharethroughBidAdapter.js +1 -1
  107. package/dist/shinezBidAdapter.js +1 -1
  108. package/dist/smaatoBidAdapter.js +1 -1
  109. package/dist/smartadserverBidAdapter.js +1 -1
  110. package/dist/smartxBidAdapter.js +1 -1
  111. package/dist/smartyadsBidAdapter.js +1 -1
  112. package/dist/smilewantedBidAdapter.js +1 -1
  113. package/dist/sonobiBidAdapter.js +1 -1
  114. package/dist/sovrnAnalyticsAdapter.js +1 -1
  115. package/dist/sovrnBidAdapter.js +1 -1
  116. package/dist/sspBCBidAdapter.js +1 -1
  117. package/dist/stroeerCoreBidAdapter.js +1 -1
  118. package/dist/stvBidAdapter.js +1 -1
  119. package/dist/sublimeBidAdapter.js +1 -1
  120. package/dist/targetVideoBidAdapter.js +1 -1
  121. package/dist/teadsBidAdapter.js +1 -1
  122. package/dist/topicsFpdModule.js +1 -1
  123. package/dist/trafficgateBidAdapter.js +1 -1
  124. package/dist/trionBidAdapter.js +1 -1
  125. package/dist/tripleliftBidAdapter.js +1 -1
  126. package/dist/ttdBidAdapter.js +1 -1
  127. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  128. package/dist/uid2IdSystem.js +1 -1
  129. package/dist/underdogmediaBidAdapter.js +1 -1
  130. package/dist/undertoneBidAdapter.js +1 -1
  131. package/dist/userId.js +1 -1
  132. package/dist/vidazooBidAdapter.js +1 -1
  133. package/dist/videobyteBidAdapter.js +1 -1
  134. package/dist/visxBidAdapter.js +1 -1
  135. package/dist/voxBidAdapter.js +1 -1
  136. package/dist/vuukleBidAdapter.js +1 -1
  137. package/dist/widespaceBidAdapter.js +1 -1
  138. package/dist/winrBidAdapter.js +1 -1
  139. package/dist/yahoosspBidAdapter.js +1 -1
  140. package/dist/yandexBidAdapter.js +1 -1
  141. package/dist/yieldmoBidAdapter.js +1 -1
  142. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  143. package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +1 -1
  144. package/integrationExamples/videoModule/jwplayer/eventListeners.html +2 -2
  145. package/integrationExamples/videoModule/jwplayer/eventsUI.html +1 -1
  146. package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +1 -1
  147. package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +1 -1
  148. package/integrationExamples/videoModule/jwplayer/playlist.html +1 -1
  149. package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +1 -1
  150. package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +1 -1
  151. package/integrationExamples/videoModule/videojs/eventListeners.html +1 -1
  152. package/integrationExamples/videoModule/videojs/eventsUI.html +1 -1
  153. package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +1 -1
  154. package/integrationExamples/videoModule/videojs/mediaMetadata.html +1 -1
  155. package/integrationExamples/videoModule/videojs/playlist.html +1 -1
  156. package/modules/33acrossBidAdapter.js +24 -14
  157. package/modules/33acrossIdSystem.js +15 -4
  158. package/modules/adagioBidAdapter.js +2 -2
  159. package/modules/admanBidAdapter.js +4 -0
  160. package/modules/adtelligentBidAdapter.js +8 -0
  161. package/modules/beopBidAdapter.js +6 -6
  162. package/modules/beopBidAdapter.md +35 -1
  163. package/modules/brandmetricsRtdProvider.js +36 -2
  164. package/modules/brandmetricsRtdProvider.md +17 -2
  165. package/modules/cadentApertureMXBidAdapter.md +2 -2
  166. package/modules/discoveryBidAdapter.js +1 -1
  167. package/modules/gdprEnforcement.js +27 -22
  168. package/modules/gridBidAdapter.js +19 -0
  169. package/modules/holidBidAdapter.js +49 -30
  170. package/modules/ixBidAdapter.js +41 -2
  171. package/modules/kargoBidAdapter.js +4 -0
  172. package/modules/livewrappedAnalyticsAdapter.js +33 -33
  173. package/modules/mediagoBidAdapter.js +1 -0
  174. package/modules/minutemediaBidAdapter.js +17 -2
  175. package/modules/oguryBidAdapter.js +29 -16
  176. package/modules/pubmaticBidAdapter.js +16 -1
  177. package/modules/pulsepointBidAdapter.js +63 -424
  178. package/modules/pulsepointBidAdapter.md +39 -45
  179. package/modules/sharedIdSystem.js +1 -1
  180. package/modules/smartyadsBidAdapter.js +6 -3
  181. package/modules/sovrnBidAdapter.js +10 -1
  182. package/modules/stroeerCoreBidAdapter.js +2 -3
  183. package/modules/teadsBidAdapter.js +2 -0
  184. package/modules/topicsFpdModule.js +4 -1
  185. package/modules/topicsFpdModule.md +4 -0
  186. package/modules/trafficgateBidAdapter.js +126 -72
  187. package/modules/userId/index.js +2 -2
  188. package/modules/vidazooBidAdapter.js +69 -19
  189. package/modules/voxBidAdapter.js +16 -5
  190. package/modules/yahoosspBidAdapter.js +38 -33
  191. package/modules/yahoosspBidAdapter.md +96 -95
  192. package/modules/yandexBidAdapter.js +12 -15
  193. package/package.json +1 -1
  194. package/src/activities/redactor.js +1 -1
  195. package/src/auction.js +24 -2
  196. package/src/constants.json +3 -1
  197. package/src/fpd/sua.js +8 -2
  198. package/test/spec/auctionmanager_spec.js +29 -1
  199. package/test/spec/fpd/enrichment_spec.js +7 -1
  200. package/test/spec/fpd/sua_spec.js +12 -0
  201. package/test/spec/modules/33acrossBidAdapter_spec.js +188 -35
  202. package/test/spec/modules/33acrossIdSystem_spec.js +122 -27
  203. package/test/spec/modules/adagioBidAdapter_spec.js +2 -2
  204. package/test/spec/modules/adtelligentBidAdapter_spec.js +8 -0
  205. package/test/spec/modules/beopBidAdapter_spec.js +18 -2
  206. package/test/spec/modules/brandmetricsRtdProvider_spec.js +69 -7
  207. package/test/spec/modules/cadentApertureMXBidAdapter_spec.js +1 -1
  208. package/test/spec/modules/gdprEnforcement_spec.js +43 -2
  209. package/test/spec/modules/gridBidAdapter_spec.js +42 -0
  210. package/test/spec/modules/holidBidAdapter_spec.js +26 -6
  211. package/test/spec/modules/ixBidAdapter_spec.js +84 -6
  212. package/test/spec/modules/kargoBidAdapter_spec.js +121 -106
  213. package/test/spec/modules/minutemediaBidAdapter_spec.js +36 -5
  214. package/test/spec/modules/oguryBidAdapter_spec.js +208 -108
  215. package/test/spec/modules/pubmaticBidAdapter_spec.js +119 -0
  216. package/test/spec/modules/pulsepointBidAdapter_spec.js +225 -486
  217. package/test/spec/modules/smartyadsBidAdapter_spec.js +1 -1
  218. package/test/spec/modules/sovrnBidAdapter_spec.js +58 -4
  219. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +8 -5
  220. package/test/spec/modules/teadsBidAdapter_spec.js +70 -21
  221. package/test/spec/modules/topicsFpdModule_spec.js +10 -4
  222. package/test/spec/modules/trafficgateBidAdapter_spec.js +1349 -199
  223. package/test/spec/modules/vidazooBidAdapter_spec.js +130 -4
  224. package/test/spec/modules/voxBidAdapter_spec.js +93 -0
  225. package/test/spec/modules/yahoosspBidAdapter_spec.js +402 -314
  226. package/test/spec/modules/yandexBidAdapter_spec.js +21 -3
  227. 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() {