prebid.js 7.33.0 → 7.35.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 (219) hide show
  1. package/.devcontainer/devcontainer.json +2 -1
  2. package/.github/workflows/issue_tracker.yml +27 -16
  3. package/dist/33acrossBidAdapter.js +1 -1
  4. package/dist/33acrossIdSystem.js +1 -1
  5. package/dist/adagioBidAdapter.js +1 -1
  6. package/dist/adbookpspBidAdapter.js +1 -1
  7. package/dist/adgenerationBidAdapter.js +1 -1
  8. package/dist/admaticBidAdapter.js +1 -1
  9. package/dist/admixerBidAdapter.js +1 -1
  10. package/dist/adnuntiusBidAdapter.js +1 -1
  11. package/dist/adrelevantisBidAdapter.js +1 -1
  12. package/dist/adtrgtmeBidAdapter.js +1 -1
  13. package/dist/adxcgBidAdapter.js +1 -1
  14. package/dist/adyoulikeBidAdapter.js +1 -1
  15. package/dist/ajaBidAdapter.js +1 -1
  16. package/dist/amxBidAdapter.js +1 -1
  17. package/dist/amxIdSystem.js +1 -1
  18. package/dist/appierAnalyticsAdapter.js +1 -1
  19. package/dist/appnexusBidAdapter.js +1 -1
  20. package/dist/arcspanRtdProvider.js +1 -0
  21. package/dist/asoBidAdapter.js +1 -1
  22. package/dist/axonixBidAdapter.js +1 -1
  23. package/dist/bidglassBidAdapter.js +1 -1
  24. package/dist/big-richmediaBidAdapter.js +1 -1
  25. package/dist/bliinkBidAdapter.js +1 -1
  26. package/dist/bridgewellBidAdapter.js +1 -1
  27. package/dist/brightMountainMediaBidAdapter.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -1
  30. package/dist/concertBidAdapter.js +1 -1
  31. package/dist/connectadBidAdapter.js +1 -1
  32. package/dist/consentManagement.js +1 -1
  33. package/dist/consumableBidAdapter.js +1 -1
  34. package/dist/conversantBidAdapter.js +1 -1
  35. package/dist/craftBidAdapter.js +1 -1
  36. package/dist/criteoBidAdapter.js +1 -1
  37. package/dist/cwireBidAdapter.js +1 -1
  38. package/dist/dspxBidAdapter.js +1 -1
  39. package/dist/emx_digitalBidAdapter.js +1 -1
  40. package/dist/eplanningBidAdapter.js +1 -1
  41. package/dist/feedadBidAdapter.js +1 -1
  42. package/dist/finativeBidAdapter.js +1 -1
  43. package/dist/glimpseBidAdapter.js +1 -1
  44. package/dist/gmosspBidAdapter.js +1 -1
  45. package/dist/goldbachBidAdapter.js +1 -1
  46. package/dist/gridBidAdapter.js +1 -1
  47. package/dist/gridNMBidAdapter.js +1 -1
  48. package/dist/gumgumBidAdapter.js +1 -1
  49. package/dist/h12mediaBidAdapter.js +1 -1
  50. package/dist/hadronIdSystem.js +1 -1
  51. package/dist/holidBidAdapter.js +1 -1
  52. package/dist/id5IdSystem.js +1 -1
  53. package/dist/improvedigitalBidAdapter.js +1 -1
  54. package/dist/inmarBidAdapter.js +1 -1
  55. package/dist/insticatorBidAdapter.js +1 -1
  56. package/dist/ixBidAdapter.js +1 -1
  57. package/dist/justpremiumBidAdapter.js +1 -1
  58. package/dist/kargoBidAdapter.js +1 -1
  59. package/dist/konduitAnalyticsAdapter.js +1 -1
  60. package/dist/kueezBidAdapter.js +1 -1
  61. package/dist/kueezRtbBidAdapter.js +1 -1
  62. package/dist/lassoBidAdapter.js +1 -1
  63. package/dist/lifestreetBidAdapter.js +1 -1
  64. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  65. package/dist/logicadBidAdapter.js +1 -1
  66. package/dist/loglyliftBidAdapter.js +1 -1
  67. package/dist/lotamePanoramaIdSystem.js +1 -1
  68. package/dist/magniteAnalyticsAdapter.js +1 -1
  69. package/dist/malltvAnalyticsAdapter.js +1 -1
  70. package/dist/marsmediaBidAdapter.js +1 -1
  71. package/dist/mediafuseBidAdapter.js +1 -1
  72. package/dist/mediasquareBidAdapter.js +1 -1
  73. package/dist/mgidBidAdapter.js +1 -1
  74. package/dist/minutemediaBidAdapter.js +1 -1
  75. package/dist/nextMillenniumBidAdapter.js +1 -1
  76. package/dist/nexx360BidAdapter.js +1 -1
  77. package/dist/not-for-prod/prebid.js +140 -149
  78. package/dist/oguryBidAdapter.js +1 -1
  79. package/dist/onetagBidAdapter.js +1 -1
  80. package/dist/ooloAnalyticsAdapter.js +1 -1
  81. package/dist/openxBidAdapter.js +1 -1
  82. package/dist/ortbConverter.js +1 -1
  83. package/dist/outbrainBidAdapter.js +1 -1
  84. package/dist/parrableIdSystem.js +1 -1
  85. package/dist/permutiveRtdProvider.js +1 -1
  86. package/dist/pixfutureBidAdapter.js +1 -1
  87. package/dist/prebid-core.js +1 -1
  88. package/dist/prebidServerBidAdapter.js +1 -1
  89. package/dist/priceFloors.js +1 -1
  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/rhythmoneBidAdapter.js +1 -1
  99. package/dist/riseBidAdapter.js +1 -1
  100. package/dist/rubiconAnalyticsAdapter.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/sharethroughAnalyticsAdapter.js +1 -1
  105. package/dist/sharethroughBidAdapter.js +1 -1
  106. package/dist/shinezBidAdapter.js +1 -1
  107. package/dist/smaatoBidAdapter.js +1 -1
  108. package/dist/smartadserverBidAdapter.js +1 -1
  109. package/dist/smartxBidAdapter.js +1 -1
  110. package/dist/smartytechBidAdapter.js +1 -1
  111. package/dist/smilewantedBidAdapter.js +1 -1
  112. package/dist/sonobiBidAdapter.js +1 -1
  113. package/dist/sovrnAnalyticsAdapter.js +1 -1
  114. package/dist/sovrnBidAdapter.js +1 -1
  115. package/dist/sspBCBidAdapter.js +1 -1
  116. package/dist/sublimeBidAdapter.js +1 -1
  117. package/dist/synacormediaBidAdapter.js +1 -1
  118. package/dist/taboolaBidAdapter.js +1 -1
  119. package/dist/targetVideoBidAdapter.js +1 -1
  120. package/dist/teadsBidAdapter.js +1 -1
  121. package/dist/trionBidAdapter.js +1 -1
  122. package/dist/tripleliftBidAdapter.js +1 -1
  123. package/dist/ttdBidAdapter.js +1 -1
  124. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  125. package/dist/uid2IdSystem.js +1 -1
  126. package/dist/underdogmediaBidAdapter.js +1 -1
  127. package/dist/undertoneBidAdapter.js +1 -1
  128. package/dist/vidazooBidAdapter.js +1 -1
  129. package/dist/videobyteBidAdapter.js +1 -1
  130. package/dist/visxBidAdapter.js +1 -1
  131. package/dist/vuukleBidAdapter.js +1 -1
  132. package/dist/widespaceBidAdapter.js +1 -1
  133. package/dist/winrBidAdapter.js +1 -1
  134. package/dist/yahoosspBidAdapter.js +1 -1
  135. package/dist/yieldmoBidAdapter.js +1 -1
  136. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  137. package/dist/zeta_global_sspBidAdapter.js +1 -1
  138. package/dist/zeusPrimeRtdProvider.js +4 -14
  139. package/integrationExamples/gpt/hello_world.html +0 -0
  140. package/libraries/ortbConverter/processors/default.js +19 -1
  141. package/modules/.submodules.json +1 -0
  142. package/modules/admaticBidAdapter.js +2 -1
  143. package/modules/admixerBidAdapter.js +26 -4
  144. package/modules/adnuntiusBidAdapter.js +36 -38
  145. package/modules/adyoulikeBidAdapter.js +2 -0
  146. package/modules/arcspanRtdProvider.js +73 -0
  147. package/modules/arcspanRtdProvider.md +11 -0
  148. package/modules/bliinkBidAdapter.js +1 -1
  149. package/modules/consentManagement.js +33 -5
  150. package/modules/consumableBidAdapter.js +20 -2
  151. package/modules/criteoBidAdapter.js +1 -1
  152. package/modules/cwireBidAdapter.js +169 -242
  153. package/modules/cwireBidAdapter.md +15 -14
  154. package/modules/emx_digitalBidAdapter.js +9 -2
  155. package/modules/hadronIdSystem.js +37 -32
  156. package/modules/holidBidAdapter.js +9 -4
  157. package/modules/kargoBidAdapter.js +5 -1
  158. package/modules/lotamePanoramaIdSystem.js +9 -1
  159. package/modules/nextMillenniumBidAdapter.js +19 -9
  160. package/modules/nexx360BidAdapter.js +1 -2
  161. package/modules/onetagBidAdapter.js +12 -1
  162. package/modules/openxBidAdapter.js +5 -0
  163. package/modules/outbrainBidAdapter.js +103 -6
  164. package/modules/permutiveRtdProvider.js +17 -12
  165. package/modules/prebidServerBidAdapter/index.js +14 -1
  166. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  167. package/modules/priceFloors.js +7 -8
  168. package/modules/pulsepointBidAdapter.js +2 -0
  169. package/modules/seedingAllianceBidAdapter.js +129 -116
  170. package/modules/smartadserverBidAdapter.js +39 -28
  171. package/modules/smartyadsBidAdapter.md +9 -0
  172. package/modules/smartytechBidAdapter.js +67 -10
  173. package/modules/smartytechBidAdapter.md +44 -33
  174. package/modules/sonobiBidAdapter.js +17 -10
  175. package/modules/taboolaBidAdapter.js +2 -1
  176. package/modules/tripleliftBidAdapter.js +4 -0
  177. package/modules/vidazooBidAdapter.js +56 -22
  178. package/modules/zeta_global_sspBidAdapter.js +15 -0
  179. package/modules/zeusPrimeRtdProvider.js +3 -323
  180. package/modules/zeusPrimeRtdProvider.md +3 -0
  181. package/package.json +1 -1
  182. package/src/adloader.js +2 -1
  183. package/src/auction.js +2 -11
  184. package/src/prebid.js +8 -0
  185. package/src/utils/cpm.js +17 -0
  186. package/test/spec/modules/admixerBidAdapter_spec.js +140 -60
  187. package/test/spec/modules/adnuntiusBidAdapter_spec.js +120 -120
  188. package/test/spec/modules/adyoulikeBidAdapter_spec.js +3 -0
  189. package/test/spec/modules/arcspanRtdProvider_spec.js +187 -0
  190. package/test/spec/modules/bliinkBidAdapter_spec.js +7 -7
  191. package/test/spec/modules/consentManagement_spec.js +49 -1
  192. package/test/spec/modules/consumableBidAdapter_spec.js +46 -0
  193. package/test/spec/modules/cwireBidAdapter_spec.js +249 -335
  194. package/test/spec/modules/emx_digitalBidAdapter_spec.js +30 -1
  195. package/test/spec/modules/hadronIdSystem_spec.js +4 -6
  196. package/test/spec/modules/holidBidAdapter_spec.js +29 -0
  197. package/test/spec/modules/kargoBidAdapter_spec.js +32 -0
  198. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +16 -10
  199. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +14 -2
  200. package/test/spec/modules/nexx360BidAdapter_spec.js +0 -4
  201. package/test/spec/modules/onetagBidAdapter_spec.js +43 -0
  202. package/test/spec/modules/openxBidAdapter_spec.js +41 -0
  203. package/test/spec/modules/openxOrtbBidAdapter_spec.js +41 -0
  204. package/test/spec/modules/outbrainBidAdapter_spec.js +182 -18
  205. package/test/spec/modules/prebidServerBidAdapter_spec.js +138 -0
  206. package/test/spec/modules/pulsepointBidAdapter_spec.js +11 -1
  207. package/test/spec/modules/seedingAllianceAdapter_spec.js +66 -23
  208. package/test/spec/modules/smartadserverBidAdapter_spec.js +116 -5
  209. package/test/spec/modules/smartytechBidAdapter_spec.js +172 -14
  210. package/test/spec/modules/sonobiBidAdapter_spec.js +2 -1
  211. package/test/spec/modules/taboolaBidAdapter_spec.js +12 -3
  212. package/test/spec/modules/tripleliftBidAdapter_spec.js +13 -0
  213. package/test/spec/modules/userId_spec.js +19 -14
  214. package/test/spec/modules/vidazooBidAdapter_spec.js +61 -22
  215. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +8 -0
  216. package/test/spec/ortbConverter/default_processors_spec.js +23 -0
  217. package/test/spec/unit/pbjs_api_spec.js +14 -0
  218. package/test/spec/unit/utils/cpm_spec.js +64 -0
  219. package/test/spec/modules/zeusPrimeRtdProvider_spec.js +0 -410
@@ -1,4 +1,4 @@
1
- import { expect } from 'chai';
1
+ import {expect} from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
4
  SUPPORTED_ID_SYSTEMS,
@@ -15,9 +15,10 @@ import {
15
15
  getVidazooSessionId,
16
16
  } from 'modules/vidazooBidAdapter.js';
17
17
  import * as utils from 'src/utils.js';
18
- import { version } from 'package.json';
19
- import { useFakeTimers } from 'sinon';
20
- import { BANNER, VIDEO } from '../../../src/mediaTypes';
18
+ import {version} from 'package.json';
19
+ import {useFakeTimers} from 'sinon';
20
+ import {BANNER, VIDEO} from '../../../src/mediaTypes';
21
+ import {config} from '../../../src/config';
21
22
 
22
23
  const SUB_DOMAIN = 'openrtb';
23
24
 
@@ -38,6 +39,10 @@ const BID = {
38
39
  'transactionId': 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
39
40
  'sizes': [[300, 250], [300, 600]],
40
41
  'bidderRequestId': '1fdb5ff1b6eaa7',
42
+ 'auctionId': 'auction_id',
43
+ 'bidRequestsCount': 4,
44
+ 'bidderRequestsCount': 3,
45
+ 'bidderWinsCount': 1,
41
46
  'requestId': 'b0777d85-d061-450e-9bc7-260dd54bbb7a',
42
47
  'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
43
48
  'mediaTypes': [BANNER],
@@ -53,6 +58,10 @@ const VIDEO_BID = {
53
58
  'adUnitCode': '63550ad1ff6642d368cba59dh5884270560',
54
59
  'bidderRequestId': '12a8ae9ada9c13',
55
60
  'transactionId': '56e184c6-bde9-497b-b9b9-cf47a61381ee',
61
+ 'auctionId': 'auction_id',
62
+ 'bidRequestsCount': 4,
63
+ 'bidderRequestsCount': 3,
64
+ 'bidderWinsCount': 1,
56
65
  'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
57
66
  'params': {
58
67
  'subDomain': SUB_DOMAIN,
@@ -85,6 +94,8 @@ const BIDDER_REQUEST = {
85
94
  'consentString': 'consent_string',
86
95
  'gdprApplies': true
87
96
  },
97
+ 'gppString': 'gpp_string',
98
+ 'gppSid': [7],
88
99
  'uspConsent': 'consent_string',
89
100
  'refererInfo': {
90
101
  'page': 'https://www.greatsite.com',
@@ -94,6 +105,10 @@ const BIDDER_REQUEST = {
94
105
  'site': {
95
106
  'cat': ['IAB2'],
96
107
  'pagecat': ['IAB2-2']
108
+ },
109
+ 'regs': {
110
+ 'gpp': 'gpp_string',
111
+ 'gpp_sid': [7]
97
112
  }
98
113
  },
99
114
  };
@@ -147,7 +162,7 @@ const REQUEST = {
147
162
 
148
163
  function getTopWindowQueryParams() {
149
164
  try {
150
- const parsedUrl = utils.parseUrl(window.top.document.URL, { decodeSearchAsString: true });
165
+ const parsedUrl = utils.parseUrl(window.top.document.URL, {decodeSearchAsString: true});
151
166
  return parsedUrl.search;
152
167
  } catch (e) {
153
168
  return '';
@@ -226,6 +241,9 @@ describe('VidazooBidAdapter', function () {
226
241
 
227
242
  it('should build video request', function () {
228
243
  const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
244
+ config.setConfig({
245
+ bidderTimeout: 3000
246
+ });
229
247
  const requests = adapter.buildRequests([VIDEO_BID], BIDDER_REQUEST);
230
248
  expect(requests).to.have.length(1);
231
249
  expect(requests[0]).to.deep.equal({
@@ -243,6 +261,15 @@ describe('VidazooBidAdapter', function () {
243
261
  gdpr: 1,
244
262
  gdprConsent: 'consent_string',
245
263
  usPrivacy: 'consent_string',
264
+ gppString: 'gpp_string',
265
+ gppSid: [7],
266
+ auctionId: 'auction_id',
267
+ bidRequestsCount: 4,
268
+ bidderRequestsCount: 3,
269
+ bidderWinsCount: 1,
270
+ bidderTimeout: 3000,
271
+ transactionId: '56e184c6-bde9-497b-b9b9-cf47a61381ee',
272
+ bidderRequestId: '12a8ae9ada9c13',
246
273
  gpid: '',
247
274
  prebidVersion: version,
248
275
  ptrace: '1000',
@@ -278,6 +305,9 @@ describe('VidazooBidAdapter', function () {
278
305
  });
279
306
 
280
307
  it('should build banner request for each size', function () {
308
+ config.setConfig({
309
+ bidderTimeout: 3000
310
+ });
281
311
  const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
282
312
  const requests = adapter.buildRequests([BID], BIDDER_REQUEST);
283
313
  expect(requests).to.have.length(1);
@@ -288,6 +318,15 @@ describe('VidazooBidAdapter', function () {
288
318
  gdprConsent: 'consent_string',
289
319
  gdpr: 1,
290
320
  usPrivacy: 'consent_string',
321
+ gppString: 'gpp_string',
322
+ gppSid: [7],
323
+ auctionId: 'auction_id',
324
+ bidRequestsCount: 4,
325
+ bidderRequestsCount: 3,
326
+ bidderWinsCount: 1,
327
+ bidderTimeout: 3000,
328
+ transactionId: 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
329
+ bidderRequestId: '1fdb5ff1b6eaa7',
291
330
  sizes: ['300x250', '300x600'],
292
331
  url: 'https%3A%2F%2Fwww.greatsite.com',
293
332
  referrer: 'https://www.somereferrer.com',
@@ -324,7 +363,7 @@ describe('VidazooBidAdapter', function () {
324
363
 
325
364
  describe('getUserSyncs', function () {
326
365
  it('should have valid user sync with iframeEnabled', function () {
327
- const result = adapter.getUserSyncs({ iframeEnabled: true }, [SERVER_RESPONSE]);
366
+ const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
328
367
 
329
368
  expect(result).to.deep.equal([{
330
369
  type: 'iframe',
@@ -333,7 +372,7 @@ describe('VidazooBidAdapter', function () {
333
372
  });
334
373
 
335
374
  it('should have valid user sync with cid on response', function () {
336
- const result = adapter.getUserSyncs({ iframeEnabled: true }, [SERVER_RESPONSE]);
375
+ const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
337
376
  expect(result).to.deep.equal([{
338
377
  type: 'iframe',
339
378
  url: 'https://sync.cootlogix.com/api/sync/iframe/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy='
@@ -341,7 +380,7 @@ describe('VidazooBidAdapter', function () {
341
380
  });
342
381
 
343
382
  it('should have valid user sync with pixelEnabled', function () {
344
- const result = adapter.getUserSyncs({ pixelEnabled: true }, [SERVER_RESPONSE]);
383
+ const result = adapter.getUserSyncs({pixelEnabled: true}, [SERVER_RESPONSE]);
345
384
 
346
385
  expect(result).to.deep.equal([{
347
386
  'url': 'https://sync.cootlogix.com/api/sync/image/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy=',
@@ -357,12 +396,12 @@ describe('VidazooBidAdapter', function () {
357
396
  });
358
397
 
359
398
  it('should return empty array when there is no ad', function () {
360
- const responses = adapter.interpretResponse({ price: 1, ad: '' });
399
+ const responses = adapter.interpretResponse({price: 1, ad: ''});
361
400
  expect(responses).to.be.empty;
362
401
  });
363
402
 
364
403
  it('should return empty array when there is no price', function () {
365
- const responses = adapter.interpretResponse({ price: null, ad: 'great ad' });
404
+ const responses = adapter.interpretResponse({price: null, ad: 'great ad'});
366
405
  expect(responses).to.be.empty;
367
406
  });
368
407
 
@@ -422,11 +461,11 @@ describe('VidazooBidAdapter', function () {
422
461
  const userId = (function () {
423
462
  switch (idSystemProvider) {
424
463
  case 'lipb':
425
- return { lipbid: id };
464
+ return {lipbid: id};
426
465
  case 'parrableId':
427
- return { eid: id };
466
+ return {eid: id};
428
467
  case 'id5id':
429
- return { uid: id };
468
+ return {uid: id};
430
469
  default:
431
470
  return id;
432
471
  }
@@ -445,18 +484,18 @@ describe('VidazooBidAdapter', function () {
445
484
 
446
485
  describe('alternate param names extractors', function () {
447
486
  it('should return undefined when param not supported', function () {
448
- const cid = extractCID({ 'c_id': '1' });
449
- const pid = extractPID({ 'p_id': '1' });
450
- const subDomain = extractSubDomain({ 'sub_domain': 'prebid' });
487
+ const cid = extractCID({'c_id': '1'});
488
+ const pid = extractPID({'p_id': '1'});
489
+ const subDomain = extractSubDomain({'sub_domain': 'prebid'});
451
490
  expect(cid).to.be.undefined;
452
491
  expect(pid).to.be.undefined;
453
492
  expect(subDomain).to.be.undefined;
454
493
  });
455
494
 
456
495
  it('should return value when param supported', function () {
457
- const cid = extractCID({ 'cID': '1' });
458
- const pid = extractPID({ 'Pid': '2' });
459
- const subDomain = extractSubDomain({ 'subDOMAIN': 'prebid' });
496
+ const cid = extractCID({'cID': '1'});
497
+ const pid = extractPID({'Pid': '2'});
498
+ const subDomain = extractSubDomain({'subDOMAIN': 'prebid'});
460
499
  expect(cid).to.be.equal('1');
461
500
  expect(pid).to.be.equal('2');
462
501
  expect(subDomain).to.be.equal('prebid');
@@ -569,7 +608,7 @@ describe('VidazooBidAdapter', function () {
569
608
  now
570
609
  });
571
610
  setStorageItem('myKey', 2020);
572
- const { value, created } = getStorageItem('myKey');
611
+ const {value, created} = getStorageItem('myKey');
573
612
  expect(created).to.be.equal(now);
574
613
  expect(value).to.be.equal(2020);
575
614
  expect(typeof value).to.be.equal('number');
@@ -585,8 +624,8 @@ describe('VidazooBidAdapter', function () {
585
624
  });
586
625
 
587
626
  it('should parse JSON value', function () {
588
- const data = JSON.stringify({ event: 'send' });
589
- const { event } = tryParseJSON(data);
627
+ const data = JSON.stringify({event: 'send'});
628
+ const {event} = tryParseJSON(data);
590
629
  expect(event).to.be.equal('send');
591
630
  });
592
631
 
@@ -41,6 +41,7 @@ describe('Zeta Ssp Bid Adapter', function () {
41
41
  app: {
42
42
  bundle: 'testBundle'
43
43
  },
44
+ bidfloor: 0.2,
44
45
  test: 1
45
46
  };
46
47
 
@@ -359,4 +360,11 @@ describe('Zeta Ssp Bid Adapter', function () {
359
360
 
360
361
  expect(payload.tmax).to.be.undefined;
361
362
  });
363
+
364
+ it('Test provide bidfloor', function () {
365
+ const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
366
+ const payload = JSON.parse(request.data);
367
+
368
+ expect(payload.imp[0].bidfloor).to.eql(params.bidfloor);
369
+ });
362
370
  });
@@ -0,0 +1,23 @@
1
+ import {onlyOneClientSection} from '../../../libraries/ortbConverter/processors/default.js';
2
+
3
+ describe('onlyOneClientSection', () => {
4
+ [
5
+ [['app'], 'app'],
6
+ [['site'], 'site'],
7
+ [['dooh'], 'dooh'],
8
+ [['app', 'site'], 'app'],
9
+ [['dooh', 'app', 'site'], 'dooh'],
10
+ [['dooh', 'site'], 'dooh']
11
+ ].forEach(([sections, winner]) => {
12
+ it(`should leave only ${winner} in request when it contains ${sections.join(', ')}`, () => {
13
+ const req = Object.fromEntries(sections.map(s => [s, {foo: 'bar'}]));
14
+ onlyOneClientSection(req);
15
+ expect(Object.keys(req)).to.eql([winner]);
16
+ })
17
+ });
18
+ it('should not choke if none of the sections are in the request', () => {
19
+ const req = {};
20
+ onlyOneClientSection(req);
21
+ expect(req).to.eql({});
22
+ });
23
+ });
@@ -3017,6 +3017,20 @@ describe('Unit: Prebid Module', function () {
3017
3017
  });
3018
3018
  });
3019
3019
 
3020
+ describe('aliasRegistry', function () {
3021
+ it('should return the same value as adapterManager.aliasRegistry by default', function () {
3022
+ const adapterManagerAliasRegistry = adapterManager.aliasRegistry;
3023
+ const pbjsAliasRegistry = $$PREBID_GLOBAL$$.aliasRegistry;
3024
+ assert.equal(adapterManagerAliasRegistry, pbjsAliasRegistry);
3025
+ });
3026
+
3027
+ it('should return undefined if the aliasRegistry config option is set to private', function () {
3028
+ configObj.setConfig({ aliasRegistry: 'private' });
3029
+ const pbjsAliasRegistry = $$PREBID_GLOBAL$$.aliasRegistry;
3030
+ assert.equal(pbjsAliasRegistry, undefined);
3031
+ });
3032
+ });
3033
+
3020
3034
  describe('setPriceGranularity', function () {
3021
3035
  it('should log error when not passed granularity', function () {
3022
3036
  const logErrorSpy = sinon.spy(utils, 'logError');
@@ -0,0 +1,64 @@
1
+ import {adjustCpm} from '../../../../src/utils/cpm.js';
2
+
3
+ describe('adjustCpm', () => {
4
+ const bidderCode = 'mockBidder';
5
+ let adjustmentFn, bs, index;
6
+ beforeEach(() => {
7
+ bs = {
8
+ get: sinon.stub()
9
+ }
10
+ index = {
11
+ getBidRequest: sinon.stub()
12
+ }
13
+ adjustmentFn = sinon.stub().callsFake((cpm) => cpm * 2);
14
+ })
15
+
16
+ it('throws when neither bidRequest nor bidResponse are provided', () => {
17
+ expect(() => adjustCpm(1)).to.throw();
18
+ })
19
+
20
+ it('always provides an object as bidResponse for the adjustment fn', () => {
21
+ bs.get.callsFake(() => adjustmentFn);
22
+ adjustCpm(1, null, {bidder: bidderCode}, {index, bs});
23
+ sinon.assert.calledWith(adjustmentFn, 1, {});
24
+ });
25
+
26
+ describe('when no bidRequest is provided', () => {
27
+ Object.entries({
28
+ 'unavailable': undefined,
29
+ 'found': {foo: 'bar'}
30
+ }).forEach(([t, req]) => {
31
+ describe(`and it is ${t} in the index`, () => {
32
+ beforeEach(() => {
33
+ bs.get.callsFake(() => adjustmentFn);
34
+ index.getBidRequest.callsFake(() => req)
35
+ });
36
+
37
+ it('provides it to the adjustment fn', () => {
38
+ const bidResponse = {bidderCode};
39
+ adjustCpm(1, bidResponse, undefined, {index, bs});
40
+ sinon.assert.calledWith(index.getBidRequest, bidResponse);
41
+ sinon.assert.calledWith(adjustmentFn, 1, bidResponse, req);
42
+ })
43
+ })
44
+ })
45
+ });
46
+
47
+ Object.entries({
48
+ 'bidResponse': [{bidderCode}],
49
+ 'bidRequest': [null, {bidder: bidderCode}],
50
+ }).forEach(([t, [bidResp, bidReq]]) => {
51
+ describe(`when passed ${t}`, () => {
52
+ beforeEach(() => {
53
+ bs.get.callsFake((bidder) => { if (bidder === bidderCode) return adjustmentFn });
54
+ });
55
+ it('retrieves the correct bidder code', () => {
56
+ expect(adjustCpm(1, bidResp, bidReq, {bs, index})).to.eql(2);
57
+ });
58
+ it('passes them to the adjustment fn', () => {
59
+ adjustCpm(1, bidResp, bidReq, {bs, index});
60
+ sinon.assert.calledWith(adjustmentFn, 1, bidResp == null ? sinon.match.any : bidResp, bidReq);
61
+ });
62
+ });
63
+ })
64
+ });