prebid.js 9.0.0 → 9.2.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 (307) hide show
  1. package/.nvmrc +1 -1
  2. package/browsers.json +3 -3
  3. package/dist/33acrossAnalyticsAdapter.js +1 -1
  4. package/dist/33acrossBidAdapter.js +1 -1
  5. package/dist/33acrossIdSystem.js +1 -1
  6. package/dist/BTBidAdapter.js +1 -1
  7. package/dist/acuityadsBidAdapter.js +1 -1
  8. package/dist/adagioAnalyticsAdapter.js +1 -1
  9. package/dist/adagioBidAdapter.js +1 -1
  10. package/dist/adagioRtdProvider.js +1 -1
  11. package/dist/adagioUtils.js +1 -0
  12. package/dist/adgenerationBidAdapter.js +1 -1
  13. package/dist/admanBidAdapter.js +1 -1
  14. package/dist/adpod.js +1 -1
  15. package/dist/adprimeBidAdapter.js +1 -1
  16. package/dist/adqueryBidAdapter.js +1 -1
  17. package/dist/adrelevantisBidAdapter.js +1 -1
  18. package/dist/adstirBidAdapter.js +1 -1
  19. package/dist/adtrgtmeBidAdapter.js +1 -1
  20. package/dist/adxcgBidAdapter.js +1 -1
  21. package/dist/adyoulikeBidAdapter.js +1 -1
  22. package/dist/agmaAnalyticsAdapter.js +1 -1
  23. package/dist/ajaBidAdapter.js +1 -1
  24. package/dist/amxBidAdapter.js +1 -1
  25. package/dist/amxIdSystem.js +1 -1
  26. package/dist/appierAnalyticsAdapter.js +1 -1
  27. package/dist/appnexusBidAdapter.js +1 -1
  28. package/dist/appnexusUtils.js +1 -1
  29. package/dist/asoBidAdapter.js +1 -1
  30. package/dist/autoplayDetection.js +1 -1
  31. package/dist/axisBidAdapter.js +1 -1
  32. package/dist/axonixBidAdapter.js +1 -1
  33. package/dist/beyondmediaBidAdapter.js +1 -1
  34. package/dist/bidglassBidAdapter.js +1 -1
  35. package/dist/big-richmediaBidAdapter.js +1 -1
  36. package/dist/bliinkBidAdapter.js +1 -1
  37. package/dist/boldwinBidAdapter.js +1 -1
  38. package/dist/bridBidAdapter.js +1 -1
  39. package/dist/bridgewellBidAdapter.js +1 -1
  40. package/dist/brightMountainMediaBidAdapter.js +1 -1
  41. package/dist/carodaBidAdapter.js +1 -1
  42. package/dist/chtnwBidAdapter.js +1 -1
  43. package/dist/chunk-core.js +1 -1
  44. package/dist/compassBidAdapter.js +1 -1
  45. package/dist/concertBidAdapter.js +1 -1
  46. package/dist/connectadBidAdapter.js +1 -1
  47. package/dist/consumableBidAdapter.js +1 -1
  48. package/dist/contentexchangeBidAdapter.js +1 -1
  49. package/dist/conversantAnalyticsAdapter.js +1 -1
  50. package/dist/conversantBidAdapter.js +1 -1
  51. package/dist/craftBidAdapter.js +1 -1
  52. package/dist/criteoBidAdapter.js +1 -1
  53. package/dist/cwireBidAdapter.js +1 -1
  54. package/dist/dailymotionBidAdapter.js +1 -1
  55. package/dist/dependencies.json +83 -4
  56. package/dist/dspxBidAdapter.js +1 -1
  57. package/dist/dxkultureBidAdapter.js +1 -1
  58. package/dist/e_volutionBidAdapter.js +1 -1
  59. package/dist/emtvBidAdapter.js +1 -1
  60. package/dist/eplanningBidAdapter.js +1 -1
  61. package/dist/euidIdSystem.js +1 -1
  62. package/dist/exadsBidAdapter.js +1 -1
  63. package/dist/feedadBidAdapter.js +1 -1
  64. package/dist/finativeBidAdapter.js +1 -1
  65. package/dist/freewheel-sspBidAdapter.js +1 -1
  66. package/dist/globalsunBidAdapter.js +1 -1
  67. package/dist/gmosspBidAdapter.js +1 -1
  68. package/dist/goldbachBidAdapter.js +1 -1
  69. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  70. package/dist/greenbidsRtdProvider.js +1 -1
  71. package/dist/gridBidAdapter.js +1 -1
  72. package/dist/gumgumBidAdapter.js +1 -1
  73. package/dist/h12mediaBidAdapter.js +1 -1
  74. package/dist/hypelabBidAdapter.js +1 -1
  75. package/dist/id5IdSystem.js +1 -1
  76. package/dist/illuminBidAdapter.js +1 -1
  77. package/dist/imdsBidAdapter.js +1 -1
  78. package/dist/improvedigitalBidAdapter.js +1 -1
  79. package/dist/insticatorBidAdapter.js +1 -1
  80. package/dist/iqzoneBidAdapter.js +1 -1
  81. package/dist/ixBidAdapter.js +1 -1
  82. package/dist/jixieBidAdapter.js +1 -1
  83. package/dist/justpremiumBidAdapter.js +1 -1
  84. package/dist/kargoBidAdapter.js +1 -1
  85. package/dist/kimberliteBidAdapter.js +1 -1
  86. package/dist/kiviadsBidAdapter.js +1 -1
  87. package/dist/konduitAnalyticsAdapter.js +1 -1
  88. package/dist/krushmediaBidAdapter.js +1 -1
  89. package/dist/kueezBidAdapter.js +1 -1
  90. package/dist/kueezRtbBidAdapter.js +1 -1
  91. package/dist/lassoBidAdapter.js +1 -1
  92. package/dist/lifestreetBidAdapter.js +1 -1
  93. package/dist/liveIntentIdSystem.js +1 -1
  94. package/dist/logicadBidAdapter.js +1 -1
  95. package/dist/loglyliftBidAdapter.js +1 -1
  96. package/dist/loyalBidAdapter.js +1 -1
  97. package/dist/luceadBidAdapter.js +1 -1
  98. package/dist/lunamediahbBidAdapter.js +1 -1
  99. package/dist/magniteAnalyticsAdapter.js +1 -1
  100. package/dist/malltvAnalyticsAdapter.js +1 -1
  101. package/dist/marsmediaBidAdapter.js +1 -1
  102. package/dist/mathildeadsBidAdapter.js +1 -1
  103. package/dist/mediafuseBidAdapter.js +1 -1
  104. package/dist/mediasquareBidAdapter.js +1 -1
  105. package/dist/mgidBidAdapter.js +1 -1
  106. package/dist/mgidXBidAdapter.js +1 -1
  107. package/dist/minutemediaBidAdapter.js +1 -1
  108. package/dist/missenaBidAdapter.js +1 -1
  109. package/dist/mobfoxpbBidAdapter.js +1 -1
  110. package/dist/mobianRtdProvider.js +1 -0
  111. package/dist/nexx360BidAdapter.js +1 -1
  112. package/dist/nobidAnalyticsAdapter.js +1 -1
  113. package/dist/nobidBidAdapter.js +1 -1
  114. package/dist/not-for-prod/prebid.js +190 -186
  115. package/dist/oguryBidAdapter.js +1 -1
  116. package/dist/onetagBidAdapter.js +1 -1
  117. package/dist/ooloAnalyticsAdapter.js +1 -1
  118. package/dist/openwebBidAdapter.js +1 -1
  119. package/dist/openxBidAdapter.js +1 -1
  120. package/dist/optidigitalBidAdapter.js +1 -1
  121. package/dist/ortbConverter.js +1 -1
  122. package/dist/outbrainBidAdapter.js +1 -1
  123. package/dist/ozoneBidAdapter.js +1 -1
  124. package/dist/paapi.js +1 -1
  125. package/dist/pgamsspBidAdapter.js +1 -1
  126. package/dist/pixfutureBidAdapter.js +1 -1
  127. package/dist/playdigoBidAdapter.js +1 -1
  128. package/dist/prebidServerBidAdapter.js +1 -1
  129. package/dist/pubCircleBidAdapter.js +1 -1
  130. package/dist/publinkIdSystem.js +1 -1
  131. package/dist/publirBidAdapter.js +1 -1
  132. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  133. package/dist/pubmaticBidAdapter.js +1 -1
  134. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  135. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  136. package/dist/pxyzBidAdapter.js +1 -1
  137. package/dist/qtBidAdapter.js +1 -1
  138. package/dist/quantcastBidAdapter.js +1 -1
  139. package/dist/raynRtdProvider.js +1 -1
  140. package/dist/readpeakBidAdapter.js +1 -1
  141. package/dist/relaidoBidAdapter.js +1 -1
  142. package/dist/retailspotBidAdapter.js +1 -1
  143. package/dist/rhythmoneBidAdapter.js +1 -1
  144. package/dist/richaudienceBidAdapter.js +1 -0
  145. package/dist/ringieraxelspringerBidAdapter.js +1 -1
  146. package/dist/riseBidAdapter.js +1 -1
  147. package/dist/rubiconBidAdapter.js +1 -1
  148. package/dist/seedingAllianceBidAdapter.js +1 -1
  149. package/dist/seedtagBidAdapter.js +1 -1
  150. package/dist/setupadBidAdapter.js +1 -1
  151. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  152. package/dist/sharethroughBidAdapter.js +1 -1
  153. package/dist/shinezBidAdapter.js +1 -1
  154. package/dist/shinezRtbBidAdapter.js +1 -1
  155. package/dist/smaatoBidAdapter.js +1 -1
  156. package/dist/smartadserverBidAdapter.js +1 -1
  157. package/dist/smartxBidAdapter.js +1 -1
  158. package/dist/smartytechBidAdapter.js +1 -1
  159. package/dist/smilewantedBidAdapter.js +1 -1
  160. package/dist/sonobiBidAdapter.js +1 -1
  161. package/dist/sovrnBidAdapter.js +1 -1
  162. package/dist/sspBCBidAdapter.js +1 -1
  163. package/dist/stnBidAdapter.js +1 -1
  164. package/dist/stvBidAdapter.js +1 -1
  165. package/dist/sublimeBidAdapter.js +1 -1
  166. package/dist/taboolaBidAdapter.js +1 -1
  167. package/dist/tagorasBidAdapter.js +1 -1
  168. package/dist/targetVideoBidAdapter.js +1 -1
  169. package/dist/teadsBidAdapter.js +1 -1
  170. package/dist/teqblazeUtils.js +1 -0
  171. package/dist/themoneytizerBidAdapter.js +1 -1
  172. package/dist/topicsFpdModule.js +1 -1
  173. package/dist/trionBidAdapter.js +1 -1
  174. package/dist/tripleliftBidAdapter.js +1 -1
  175. package/dist/ttdBidAdapter.js +1 -1
  176. package/dist/twistDigitalBidAdapter.js +1 -1
  177. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  178. package/dist/uid2IdSystem.js +1 -1
  179. package/dist/underdogmediaBidAdapter.js +1 -1
  180. package/dist/undertoneBidAdapter.js +1 -1
  181. package/dist/unrulyBidAdapter.js +1 -1
  182. package/dist/vidazooBidAdapter.js +1 -1
  183. package/dist/videobyteBidAdapter.js +1 -1
  184. package/dist/visiblemeasuresBidAdapter.js +1 -1
  185. package/dist/visxBidAdapter.js +1 -1
  186. package/dist/vuukleBidAdapter.js +1 -1
  187. package/dist/widespaceBidAdapter.js +1 -1
  188. package/dist/winrBidAdapter.js +1 -1
  189. package/dist/yahooAdsBidAdapter.js +1 -1
  190. package/dist/yieldmoBidAdapter.js +1 -1
  191. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  192. package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
  193. package/integrationExamples/gpt/raynRtdProvider_example.html +1 -0
  194. package/libraries/adagioUtils/adagioUtils.js +35 -0
  195. package/libraries/appnexusUtils/anUtils.js +1 -0
  196. package/libraries/autoplayDetection/autoplay.js +8 -1
  197. package/libraries/ortbConverter/converter.js +1 -1
  198. package/libraries/teqblazeUtils/bidderUtils.js +253 -0
  199. package/modules/.submodules.json +1 -0
  200. package/modules/acuityadsBidAdapter.js +5 -203
  201. package/modules/adagioBidAdapter.js +1 -17
  202. package/modules/adagioRtdProvider.js +41 -51
  203. package/modules/adagioRtdProvider.md +1 -0
  204. package/modules/admanBidAdapter.js +31 -188
  205. package/modules/adprimeBidAdapter.js +28 -165
  206. package/modules/axisBidAdapter.js +33 -165
  207. package/modules/beyondmediaBidAdapter.js +5 -189
  208. package/modules/bliinkBidAdapter.js +3 -31
  209. package/modules/boldwinBidAdapter.js +21 -159
  210. package/modules/ceeIdSystem.js +1 -1
  211. package/modules/compassBidAdapter.js +5 -198
  212. package/modules/contentexchangeBidAdapter.js +5 -200
  213. package/modules/conversantBidAdapter.js +1 -0
  214. package/modules/dailymotionBidAdapter.js +1 -1
  215. package/modules/e_volutionBidAdapter.js +4 -186
  216. package/modules/emtvBidAdapter.js +5 -198
  217. package/modules/globalsunBidAdapter.js +5 -199
  218. package/modules/id5IdSystem.js +31 -2
  219. package/modules/id5IdSystem.md +67 -2
  220. package/modules/iqzoneBidAdapter.js +5 -224
  221. package/modules/kiviadsBidAdapter.js +5 -199
  222. package/modules/krushmediaBidAdapter.js +25 -143
  223. package/modules/loyalBidAdapter.js +4 -178
  224. package/modules/lunamediahbBidAdapter.js +5 -118
  225. package/modules/mathildeadsBidAdapter.js +5 -198
  226. package/modules/mgidXBidAdapter.js +14 -209
  227. package/modules/mobfoxpbBidAdapter.js +4 -135
  228. package/modules/mobianRtdProvider.js +52 -0
  229. package/modules/mobianRtdProvider.md +11 -0
  230. package/modules/nobidAnalyticsAdapter.js +2 -3
  231. package/modules/novatiqIdSystem.md +2 -3
  232. package/modules/ozoneBidAdapter.js +117 -58
  233. package/modules/paapi.js +2 -1
  234. package/modules/pgamsspBidAdapter.js +5 -240
  235. package/modules/playdigoBidAdapter.js +4 -186
  236. package/modules/prebidServerBidAdapter/index.js +9 -2
  237. package/modules/pubCircleBidAdapter.js +5 -218
  238. package/modules/pubmaticAnalyticsAdapter.js +21 -8
  239. package/modules/pubxaiAnalyticsAdapter.js +1 -5
  240. package/modules/qtBidAdapter.js +5 -224
  241. package/modules/raynRtdProvider.js +36 -3
  242. package/modules/richaudienceBidAdapter.js +375 -0
  243. package/modules/richaudienceBidAdapter.md +1 -1
  244. package/modules/seedtagBidAdapter.js +1 -0
  245. package/modules/setupadBidAdapter.js +76 -153
  246. package/modules/setupadBidAdapter.md +1 -1
  247. package/modules/smaatoBidAdapter.js +17 -6
  248. package/modules/smartytechBidAdapter.js +7 -2
  249. package/modules/topicsFpdModule.js +1 -1
  250. package/modules/uid2IdSystem.js +0 -1
  251. package/modules/uid2IdSystem_shared.js +0 -1
  252. package/modules/visiblemeasuresBidAdapter.js +5 -199
  253. package/modules/zeta_global_sspAnalyticsAdapter.js +8 -4
  254. package/package.json +1 -1
  255. package/src/auction.js +5 -63
  256. package/src/utils/focusTimeout.js +41 -0
  257. package/src/utils/ttlCollection.js +2 -1
  258. package/src/utils.js +42 -0
  259. package/src/videoCache.js +72 -0
  260. package/test/mocks/videoCacheStub.js +1 -1
  261. package/test/spec/auctionmanager_spec.js +16 -1
  262. package/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js +519 -0
  263. package/test/spec/modules/acuityadsBidAdapter_spec.js +79 -43
  264. package/test/spec/modules/adagioRtdProvider_spec.js +62 -1
  265. package/test/spec/modules/admanBidAdapter_spec.js +370 -247
  266. package/test/spec/modules/adprimeBidAdapter_spec.js +225 -78
  267. package/test/spec/modules/axisBidAdapter_spec.js +78 -14
  268. package/test/spec/modules/beyondmediaBidAdapter_spec.js +80 -18
  269. package/test/spec/modules/bliinkBidAdapter_spec.js +8 -2
  270. package/test/spec/modules/boldwinBidAdapter_spec.js +221 -75
  271. package/test/spec/modules/compassBidAdapter_spec.js +130 -16
  272. package/test/spec/modules/contentexchangeBidAdapter_spec.js +134 -21
  273. package/test/spec/modules/conversantBidAdapter_spec.js +7 -0
  274. package/test/spec/modules/dailymotionBidAdapter_spec.js +3 -3
  275. package/test/spec/modules/e_volutionBidAdapter_spec.js +65 -3
  276. package/test/spec/modules/emtvBidAdapter_spec.js +131 -16
  277. package/test/spec/modules/globalsunBidAdapter_spec.js +130 -16
  278. package/test/spec/modules/id5IdSystem_spec.js +79 -3
  279. package/test/spec/modules/iqzoneBidAdapter_spec.js +66 -12
  280. package/test/spec/modules/kiviadsBidAdapter_spec.js +131 -20
  281. package/test/spec/modules/krushmediaBidAdapter_spec.js +272 -90
  282. package/test/spec/modules/loyalBidAdapter_spec.js +114 -14
  283. package/test/spec/modules/lunamediahbBidAdapter_spec.js +221 -87
  284. package/test/spec/modules/mathildeadsBidAdapter_spec.js +87 -18
  285. package/test/spec/modules/mgidXBidAdapter_spec.js +11 -3
  286. package/test/spec/modules/mobfoxpbBidAdapter_spec.js +229 -91
  287. package/test/spec/modules/mobianRtdProvider_spec.js +107 -0
  288. package/test/spec/modules/ozoneBidAdapter_spec.js +192 -22
  289. package/test/spec/modules/paapi_spec.js +5 -5
  290. package/test/spec/modules/pgamsspBidAdapter_spec.js +83 -16
  291. package/test/spec/modules/playdigoBidAdapter_spec.js +38 -9
  292. package/test/spec/modules/prebidServerBidAdapter_spec.js +14 -0
  293. package/test/spec/modules/pubCircleBidAdapter_spec.js +82 -17
  294. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +52 -5
  295. package/test/spec/modules/qtBidAdapter_spec.js +15 -3
  296. package/test/spec/modules/raynRtdProvider_spec.js +25 -0
  297. package/test/spec/modules/richaudienceBidAdapter_spec.js +1304 -0
  298. package/test/spec/modules/seedtagBidAdapter_spec.js +2 -0
  299. package/test/spec/modules/setupadBidAdapter_spec.js +139 -97
  300. package/test/spec/modules/smaatoBidAdapter_spec.js +27 -0
  301. package/test/spec/modules/smartytechBidAdapter_spec.js +5 -1
  302. package/test/spec/modules/topicsFpdModule_spec.js +43 -59
  303. package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +130 -16
  304. package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +4 -0
  305. package/test/spec/ortbConverter/converter_spec.js +7 -3
  306. package/test/spec/unit/utils/focusTimeout_spec.js +60 -0
  307. package/test/spec/videoCache_spec.js +56 -53
@@ -4,6 +4,7 @@ import { config } from 'src/config.js';
4
4
  import {Renderer} from '../../../src/Renderer.js';
5
5
  import {getGranularityKeyName, getGranularityObject} from '../../../modules/ozoneBidAdapter.js';
6
6
  import * as utils from '../../../src/utils.js';
7
+ import {deepSetValue} from '../../../src/utils.js';
7
8
  const OZONEURI = 'https://elb.the-ozone-project.com/openrtb2/auction';
8
9
  const BIDDER_CODE = 'ozone';
9
10
  var validBidRequests = [
@@ -401,6 +402,66 @@ var validBidderRequest = {
401
402
  start: 1536838908987,
402
403
  timeout: 3000
403
404
  };
405
+ var validBidderRequestWithCookieDeprecation = {
406
+ auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
407
+ auctionStart: 1536838908986,
408
+ bidderCode: 'ozone',
409
+ bidderRequestId: '1c1586b27a1b5c8',
410
+ bids: [{
411
+ adUnitCode: 'div-gpt-ad-1460505748561-0',
412
+ auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
413
+ bidId: '2899ec066a91ff8',
414
+ bidRequestsCount: 1,
415
+ bidder: 'ozone',
416
+ bidderRequestId: '1c1586b27a1b5c8',
417
+ crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
418
+ params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { banner: { topframe: 1, w: 300, h: 250, format: [{ w: 300, h: 250 }, { w: 300, h: 600 }] }, id: '2899ec066a91ff8', secure: 1, tagid: 'undefined' } ] },
419
+ sizes: [[300, 250], [300, 600]],
420
+ transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
421
+ }],
422
+ doneCbCallCount: 1,
423
+ start: 1536838908987,
424
+ timeout: 3000,
425
+ ortb2: {
426
+ 'device': {
427
+ 'w': 1617,
428
+ 'h': 317,
429
+ 'dnt': 0,
430
+ 'ua': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36',
431
+ 'language': 'en',
432
+ 'sua': {
433
+ 'source': 1,
434
+ 'platform': {
435
+ 'brand': 'macOS'
436
+ },
437
+ 'browsers': [
438
+ {
439
+ 'brand': 'Google Chrome',
440
+ 'version': [
441
+ '125'
442
+ ]
443
+ },
444
+ {
445
+ 'brand': 'Chromium',
446
+ 'version': [
447
+ '125'
448
+ ]
449
+ },
450
+ {
451
+ 'brand': 'Not.A/Brand',
452
+ 'version': [
453
+ '24'
454
+ ]
455
+ }
456
+ ],
457
+ 'mobile': 0
458
+ },
459
+ 'ext': {
460
+ 'cdep': 'fake_control_2'
461
+ }
462
+ }
463
+ }
464
+ };
404
465
  var bidderRequestWithFullGdpr = {
405
466
  auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
406
467
  auctionStart: 1536838908986,
@@ -1814,7 +1875,7 @@ describe('ozone Adapter', function () {
1814
1875
  });
1815
1876
  it('should add gdpr consent information to the request when ozone is true', function () {
1816
1877
  let consentString = 'BOcocyaOcocyaAfEYDENCD-AAAAjx7_______9______9uz_Ov_v_f__33e8__9v_l_7_-___u_-33d4-_1vf99yfm1-7ftr3tp_87ues2_Xur__59__3z3_NphLgA==';
1817
- let bidderRequest = validBidderRequest;
1878
+ let bidderRequest = JSON.parse(JSON.stringify(validBidderRequest));
1818
1879
  bidderRequest.gdprConsent = {
1819
1880
  consentString: consentString,
1820
1881
  gdprApplies: true,
@@ -1832,7 +1893,7 @@ describe('ozone Adapter', function () {
1832
1893
  });
1833
1894
  it('should add gdpr consent information to the request when vendorData is missing vendorConsents (Mirror)', function () {
1834
1895
  let consentString = 'BOcocyaOcocyaAfEYDENCD-AAAAjx7_______9______9uz_Ov_v_f__33e8__9v_l_7_-___u_-33d4-_1vf99yfm1-7ftr3tp_87ues2_Xur__59__3z3_NphLgA==';
1835
- let bidderRequest = validBidderRequest;
1896
+ let bidderRequest = JSON.parse(JSON.stringify(validBidderRequest));
1836
1897
  bidderRequest.gdprConsent = {
1837
1898
  consentString: consentString,
1838
1899
  gdprApplies: true,
@@ -1848,7 +1909,7 @@ describe('ozone Adapter', function () {
1848
1909
  });
1849
1910
  it('should set regs.ext.gdpr flag to 0 when gdprApplies is false', function () {
1850
1911
  let consentString = 'BOcocyaOcocyaAfEYDENCD-AAAAjx7_______9______9uz_Ov_v_f__33e8__9v_l_7_-___u_-33d4-_1vf99yfm1-7ftr3tp_87ues2_Xur__59__3z3_NphLgA==';
1851
- let bidderRequest = validBidderRequest;
1912
+ let bidderRequest = JSON.parse(JSON.stringify(validBidderRequest));
1852
1913
  bidderRequest.gdprConsent = {
1853
1914
  consentString: consentString,
1854
1915
  gdprApplies: false,
@@ -1863,9 +1924,24 @@ describe('ozone Adapter', function () {
1863
1924
  const payload = JSON.parse(request.data);
1864
1925
  expect(payload.regs.ext.gdpr).to.equal(0);
1865
1926
  });
1927
+ it('should set gpp and gpp_sid when available', function() {
1928
+ let gppString = 'gppConsentString';
1929
+ let gppSections = [7, 8, 9];
1930
+ let bidderRequest = JSON.parse(JSON.stringify(validBidderRequest));
1931
+ bidderRequest.ortb2 = {regs: {gpp: gppString, gpp_sid: gppSections}};
1932
+ const request = spec.buildRequests(validBidRequestsNoSizes, bidderRequest);
1933
+ const payload = JSON.parse(request.data);
1934
+ expect(payload.regs.gpp).to.equal(gppString);
1935
+ expect(payload.regs.gpp_sid).to.have.same.members(gppSections);
1936
+ });
1937
+ it('should not set gpp and gpp_sid keys when not available', function() {
1938
+ const request = spec.buildRequests(validBidRequestsNoSizes, validBidderRequest);
1939
+ const payload = JSON.parse(request.data);
1940
+ expect(payload).to.not.contain.keys(['gpp', 'gpp_sid', 'ext', 'regs']);
1941
+ });
1866
1942
  it('should not have imp[N].ext.ozone.userId', function () {
1867
1943
  let consentString = 'BOcocyaOcocyaAfEYDENCD-AAAAjx7_______9______9uz_Ov_v_f__33e8__9v_l_7_-___u_-33d4-_1vf99yfm1-7ftr3tp_87ues2_Xur__59__3z3_NphLgA==';
1868
- let bidderRequest = validBidderRequest;
1944
+ let bidderRequest = JSON.parse(JSON.stringify(validBidderRequest));
1869
1945
  bidderRequest.gdprConsent = {
1870
1946
  consentString: consentString,
1871
1947
  gdprApplies: false,
@@ -1876,7 +1952,7 @@ describe('ozone Adapter', function () {
1876
1952
  purposeConsents: {1: true, 2: true, 3: true, 4: true, 5: true}
1877
1953
  }
1878
1954
  };
1879
- let bidRequests = validBidRequests;
1955
+ let bidRequests = JSON.parse(JSON.stringify(validBidRequests));
1880
1956
  bidRequests[0]['userId'] = {
1881
1957
  'digitrustid': {data: {id: 'DTID', keyv: 4, privacy: {optout: false}, producer: 'ABC', version: 2}},
1882
1958
  'id5id': { uid: '1111', ext: { linkType: 2, abTestingControlGroup: false } },
@@ -1891,23 +1967,12 @@ describe('ozone Adapter', function () {
1891
1967
  const payload = JSON.parse(request.data);
1892
1968
  let firstBid = payload.imp[0].ext.ozone;
1893
1969
  expect(firstBid).to.not.have.property('userId');
1894
- delete validBidRequests[0].userId; // tidy up now, else it will screw with other tests
1895
1970
  });
1896
1971
  it('should pick up the value of pubcid when built using the pubCommonId module (not userId)', function () {
1897
1972
  let bidRequests = validBidRequests;
1898
- bidRequests[0]['userId'] = {
1899
- 'digitrustid': {data: {id: 'DTID', keyv: 4, privacy: {optout: false}, producer: 'ABC', version: 2}},
1900
- 'id5id': { uid: '1111', ext: { linkType: 2, abTestingControlGroup: false } },
1901
- 'idl_env': '3333',
1902
- 'parrableid': 'eidVersion.encryptionKeyReference.encryptedValue',
1903
- 'tdid': '6666',
1904
- 'sharedid': {'id': '01EAJWWNEPN3CYMM5N8M5VXY22', 'third': '01EAJWWNEPN3CYMM5N8M5VXY22'}
1905
- };
1906
- bidRequests[0]['userIdAsEids'] = validBidRequestsWithUserIdData[0]['userIdAsEids'];
1907
1973
  const request = spec.buildRequests(bidRequests, validBidderRequest);
1908
1974
  const payload = JSON.parse(request.data);
1909
1975
  expect(payload.ext.ozone.pubcid).to.equal(bidRequests[0]['crumbs']['pubcid']);
1910
- delete validBidRequests[0].userId; // tidy up now, else it will screw with other tests
1911
1976
  });
1912
1977
  it('should add a user.ext.eids object to contain user ID data in the new location (Nov 2019) Updated Aug 2020', function() {
1913
1978
  const request = spec.buildRequests(validBidRequestsWithUserIdData, validBidderRequest);
@@ -2056,7 +2121,7 @@ describe('ozone Adapter', function () {
2056
2121
  const data = JSON.parse(request.data);
2057
2122
  expect(data.imp[0].ext.gpid).to.equal('/22037345/projectozone');
2058
2123
  });
2059
- it('should batch into 10s if config is set', function () {
2124
+ it('should batch into 10s if config is set to true', function () {
2060
2125
  config.setConfig({ozone: {'batchRequests': true}});
2061
2126
  var specMock = utils.deepClone(spec);
2062
2127
  let arrReq = [];
@@ -2069,7 +2134,20 @@ describe('ozone Adapter', function () {
2069
2134
  expect(request.length).to.equal(3);
2070
2135
  config.resetConfig();
2071
2136
  });
2072
- it('should not batch into 10s if config is set to false and singleRequest is true', function () {
2137
+ it('should batch into 7 if config is set to 7', function () {
2138
+ config.setConfig({ozone: {'batchRequests': 7}});
2139
+ var specMock = utils.deepClone(spec);
2140
+ let arrReq = [];
2141
+ for (let i = 0; i < 25; i++) {
2142
+ let b = validBidRequests[0];
2143
+ b.adUnitCode += i;
2144
+ arrReq.push(b);
2145
+ }
2146
+ const request = specMock.buildRequests(arrReq, validBidderRequest);
2147
+ expect(request.length).to.equal(4);
2148
+ config.resetConfig();
2149
+ });
2150
+ it('should not batch if config is set to false and singleRequest is true', function () {
2073
2151
  config.setConfig({ozone: {'batchRequests': false, 'singleRequest': true}});
2074
2152
  var specMock = utils.deepClone(spec);
2075
2153
  let arrReq = [];
@@ -2082,6 +2160,57 @@ describe('ozone Adapter', function () {
2082
2160
  expect(request.method).to.equal('POST');
2083
2161
  config.resetConfig();
2084
2162
  });
2163
+ it('should not batch if config is set to invalid value -10 and singleRequest is true', function () {
2164
+ config.setConfig({ozone: {'batchRequests': -10, 'singleRequest': true}});
2165
+ var specMock = utils.deepClone(spec);
2166
+ let arrReq = [];
2167
+ for (let i = 0; i < 15; i++) {
2168
+ let b = validBidRequests[0];
2169
+ b.adUnitCode += i;
2170
+ arrReq.push(b);
2171
+ }
2172
+ const request = specMock.buildRequests(arrReq, validBidderRequest);
2173
+ expect(request.method).to.equal('POST');
2174
+ config.resetConfig();
2175
+ });
2176
+ it('should use GET values for batchRequests if found', function() {
2177
+ var specMock = utils.deepClone(spec);
2178
+ specMock.getGetParametersAsObject = function() {
2179
+ return {'batchRequests': '5'};
2180
+ };
2181
+ let arrReq = [];
2182
+ for (let i = 0; i < 25; i++) {
2183
+ let b = validBidRequests[0];
2184
+ b.adUnitCode += i;
2185
+ arrReq.push(b);
2186
+ }
2187
+ let request = specMock.buildRequests(arrReq, validBidderRequest);
2188
+ expect(request.length).to.equal(5); // 5 x 5 = 25
2189
+ specMock = utils.deepClone(spec);
2190
+ specMock.getGetParametersAsObject = function() {
2191
+ return {'batchRequests': '10'}; // the built in function will return '10' (string)
2192
+ };
2193
+ request = specMock.buildRequests(arrReq, validBidderRequest);
2194
+ expect(request.length).to.equal(3); // 10, 10, 5
2195
+ specMock = utils.deepClone(spec);
2196
+ specMock.getGetParametersAsObject = function() {
2197
+ return {'batchRequests': true};
2198
+ };
2199
+ request = specMock.buildRequests(arrReq, validBidderRequest);
2200
+ expect(request.method).to.equal('POST'); // no batching - GET param must be numeric
2201
+ specMock = utils.deepClone(spec);
2202
+ specMock.getGetParametersAsObject = function() {
2203
+ return {'batchRequests': 'true'};
2204
+ };
2205
+ request = specMock.buildRequests(arrReq, validBidderRequest);
2206
+ expect(request.method).to.equal('POST'); // no batching - GET param must be numeric
2207
+ specMock = utils.deepClone(spec);
2208
+ specMock.getGetParametersAsObject = function() {
2209
+ return {'batchRequests': -5};
2210
+ };
2211
+ request = specMock.buildRequests(arrReq, validBidderRequest);
2212
+ expect(request.method).to.equal('POST'); // no batching
2213
+ });
2085
2214
  it('should use GET values auction=dev & cookiesync=dev if set', function() {
2086
2215
  var specMock = utils.deepClone(spec);
2087
2216
  specMock.getGetParametersAsObject = function() {
@@ -2295,6 +2424,27 @@ describe('ozone Adapter', function () {
2295
2424
  expect(data.source.ext).to.haveOwnProperty('schain');
2296
2425
  expect(data.source.ext.schain).to.deep.equal(schainConfigObject); // .deep.equal() : Target object deeply (but not strictly) equals `{a: 1}`
2297
2426
  });
2427
+ it('should find ortb2 cookieDeprecation values', function () {
2428
+ let bidderRequest = JSON.parse(JSON.stringify(validBidderRequestWithCookieDeprecation));
2429
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
2430
+ const payload = JSON.parse(request.data);
2431
+ expect(payload.ext.ozone.cookieDeprecationLabel).to.equal('fake_control_2');
2432
+ });
2433
+ it('should set ortb2 cookieDeprecation to "none" if there is none', function () {
2434
+ let bidderRequest = JSON.parse(JSON.stringify(validBidderRequest));
2435
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
2436
+ const payload = JSON.parse(request.data);
2437
+ expect(payload.ext.ozone.cookieDeprecationLabel).to.equal('none');
2438
+ });
2439
+ it('should handle fledge requests', function () {
2440
+ let bidderRequest = JSON.parse(JSON.stringify(validBidderRequest));
2441
+ let bidRequests = JSON.parse(JSON.stringify(validBidRequests));
2442
+ deepSetValue(bidRequests[0], 'ortb2Imp.ext.ae', 1);
2443
+ bidderRequest.fledgeEnabled = true;
2444
+ const request = spec.buildRequests(bidRequests, bidderRequest);
2445
+ const payload = JSON.parse(request.data);
2446
+ expect(payload.imp[0].ext.ae).to.equal(1);
2447
+ });
2298
2448
  });
2299
2449
  describe('interpretResponse', function () {
2300
2450
  beforeEach(function () {
@@ -2509,6 +2659,20 @@ describe('ozone Adapter', function () {
2509
2659
  const bid = result[0];
2510
2660
  expect(bid.mediaType).to.equal('video');
2511
2661
  });
2662
+ it('should handle fledge response', function () {
2663
+ const req = spec.buildRequests(validBidRequests, validBidderRequest);
2664
+ let objResp = JSON.parse(JSON.stringify(validResponse));
2665
+ objResp.body.ext = {igi: [{
2666
+ 'impid': '1',
2667
+ 'igb': [{
2668
+ 'origin': 'https://paapi.dsp.com',
2669
+ 'pbs': '{"key": "value"}'
2670
+ }]
2671
+ }]};
2672
+ const result = spec.interpretResponse(objResp, req);
2673
+ expect(result).to.be.an('object');
2674
+ expect(result.fledgeAuctionConfigs[0]['impid']).to.equal('1');
2675
+ });
2512
2676
  });
2513
2677
  describe('userSyncs', function () {
2514
2678
  it('should fail gracefully if no server response', function () {
@@ -2540,6 +2704,10 @@ describe('ozone Adapter', function () {
2540
2704
  expect(result).to.be.an('array');
2541
2705
  expect(result[0].url).to.include('usp_consent=&');
2542
2706
  });
2707
+ it('should add gpp if its present', function () {
2708
+ const result = spec.getUserSyncs({iframeEnabled: true}, 'good server response', gdpr1, '1---', { gppString: 'gppStringHere', applicableSections: [7, 8, 9] });
2709
+ expect(result[0].url).to.include('gpp=gppStringHere&gpp_sid=7,8,9');
2710
+ });
2543
2711
  });
2544
2712
  describe('video object utils', function () {
2545
2713
  it('should find width & height from video object', function () {
@@ -2698,7 +2866,7 @@ describe('ozone Adapter', function () {
2698
2866
  });
2699
2867
  });
2700
2868
  describe('addVideoDefaults', function() {
2701
- it('should correctly add video defaults', function () {
2869
+ it('should not add video defaults if there is no videoParams config', function () {
2702
2870
  let mediaTypes = {
2703
2871
  playerSize: [640, 480],
2704
2872
  mimes: ['video/mp4'],
@@ -2715,12 +2883,14 @@ describe('ozone Adapter', function () {
2715
2883
  testKey: 'child value'
2716
2884
  };
2717
2885
  let result = spec.addVideoDefaults({}, mediaTypes, mediaTypes);
2718
- expect(result.placement).to.equal(3);
2886
+ expect(result.placement).to.be.undefined;
2719
2887
  expect(result.skip).to.equal(0);
2720
2888
  result = spec.addVideoDefaults({}, mediaTypes, bid_params_video);
2721
2889
  expect(result.skip).to.equal(1);
2722
2890
  });
2723
- it('should correctly add video defaults including skippable in parent', function () {
2891
+ it('should correctly add video defaults if page config videoParams is defined, also check skip in the parent', function () {
2892
+ var specMock = utils.deepClone(spec);
2893
+ specMock.propertyBag.whitelabel.videoParams = {outstream: 3, instream: 1};
2724
2894
  let mediaTypes = {
2725
2895
  playerSize: [640, 480],
2726
2896
  mimes: ['video/mp4'],
@@ -2736,7 +2906,7 @@ describe('ozone Adapter', function () {
2736
2906
  skipafter: 5,
2737
2907
  testKey: 'child value'
2738
2908
  };
2739
- let result = spec.addVideoDefaults({}, mediaTypes, bid_params_video);
2909
+ let result = specMock.addVideoDefaults({}, mediaTypes, bid_params_video);
2740
2910
  expect(result.placement).to.equal(3);
2741
2911
  expect(result.skip).to.equal(1);
2742
2912
  });
@@ -91,10 +91,10 @@ describe('paapi module', () => {
91
91
  let igb1, igb2, buyerAuctionConfig;
92
92
  beforeEach(() => {
93
93
  igb1 = {
94
- origin: 'buyer1'
94
+ origin: 'buyer.1'
95
95
  };
96
96
  igb2 = {
97
- origin: 'buyer2'
97
+ origin: 'buyer.2'
98
98
  };
99
99
  buyerAuctionConfig = {
100
100
  seller: 'seller',
@@ -263,11 +263,11 @@ describe('paapi module', () => {
263
263
  });
264
264
 
265
265
  it('should be added to perBuyerSignals', () => {
266
- auctionConfig.interestGroupBuyers = ['buyer1', 'buyer2'];
266
+ auctionConfig.interestGroupBuyers = ['buyer.1', 'buyer.2'];
267
267
  const pbs = getComponentAuctionConfig().perBuyerSignals;
268
268
  sinon.assert.match(pbs, {
269
- buyer1: {prebid: {ortb2, ortb2Imp}},
270
- buyer2: {prebid: {ortb2, ortb2Imp}}
269
+ 'buyer.1': {prebid: {ortb2, ortb2Imp}},
270
+ 'buyer.2': {prebid: {ortb2, ortb2Imp}}
271
271
  });
272
272
  });
273
273
 
@@ -3,9 +3,19 @@ import { spec } from '../../../modules/pgamsspBidAdapter.js';
3
3
  import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js';
4
4
  import { getUniqueIdentifierStr } from '../../../src/utils.js';
5
5
 
6
- const bidder = 'pgamssp'
6
+ const bidder = 'pgamssp';
7
7
 
8
8
  describe('PGAMBidAdapter', function () {
9
+ const userIdAsEids = [{
10
+ source: 'test.org',
11
+ uids: [{
12
+ id: '01**********',
13
+ atype: 1,
14
+ ext: {
15
+ third: '01***********'
16
+ }
17
+ }]
18
+ }];
9
19
  const bids = [
10
20
  {
11
21
  bidId: getUniqueIdentifierStr(),
@@ -16,8 +26,9 @@ describe('PGAMBidAdapter', function () {
16
26
  }
17
27
  },
18
28
  params: {
19
- placementId: 'testBanner',
20
- }
29
+ placementId: 'testBanner'
30
+ },
31
+ userIdAsEids
21
32
  },
22
33
  {
23
34
  bidId: getUniqueIdentifierStr(),
@@ -30,8 +41,9 @@ describe('PGAMBidAdapter', function () {
30
41
  }
31
42
  },
32
43
  params: {
33
- placementId: 'testVideo',
34
- }
44
+ placementId: 'testVideo'
45
+ },
46
+ userIdAsEids
35
47
  },
36
48
  {
37
49
  bidId: getUniqueIdentifierStr(),
@@ -53,8 +65,9 @@ describe('PGAMBidAdapter', function () {
53
65
  }
54
66
  },
55
67
  params: {
56
- placementId: 'testNative',
57
- }
68
+ placementId: 'testNative'
69
+ },
70
+ userIdAsEids
58
71
  }
59
72
  ];
60
73
 
@@ -74,10 +87,19 @@ describe('PGAMBidAdapter', function () {
74
87
  const bidderRequest = {
75
88
  uspConsent: '1---',
76
89
  gdprConsent: {
77
- consentString: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw'
90
+ consentString: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
91
+ vendorData: {}
78
92
  },
79
93
  refererInfo: {
80
- referer: 'https://test.com'
94
+ referer: 'https://test.com',
95
+ page: 'https://test.com'
96
+ },
97
+ ortb2: {
98
+ device: {
99
+ w: 1512,
100
+ h: 982,
101
+ language: 'en-UK'
102
+ }
81
103
  },
82
104
  timeout: 500
83
105
  };
@@ -147,7 +169,56 @@ describe('PGAMBidAdapter', function () {
147
169
  expect(placement.schain).to.be.an('object');
148
170
  expect(placement.bidfloor).to.exist.and.to.equal(0);
149
171
  expect(placement.type).to.exist.and.to.equal('publisher');
150
- expect(placement.eids).to.exist.and.to.be.an('array');
172
+ expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids);
173
+
174
+ if (placement.adFormat === BANNER) {
175
+ expect(placement.sizes).to.be.an('array');
176
+ }
177
+ switch (placement.adFormat) {
178
+ case BANNER:
179
+ expect(placement.sizes).to.be.an('array');
180
+ break;
181
+ case VIDEO:
182
+ expect(placement.playerSize).to.be.an('array');
183
+ expect(placement.minduration).to.be.an('number');
184
+ expect(placement.maxduration).to.be.an('number');
185
+ break;
186
+ case NATIVE:
187
+ expect(placement.native).to.be.an('object');
188
+ break;
189
+ }
190
+ }
191
+ });
192
+
193
+ it('Returns valid endpoints', function () {
194
+ const bids = [
195
+ {
196
+ bidId: getUniqueIdentifierStr(),
197
+ bidder: bidder,
198
+ mediaTypes: {
199
+ [BANNER]: {
200
+ sizes: [[300, 250]]
201
+ }
202
+ },
203
+ params: {
204
+ endpointId: 'testBanner',
205
+ },
206
+ userIdAsEids
207
+ }
208
+ ];
209
+
210
+ let serverRequest = spec.buildRequests(bids, bidderRequest);
211
+
212
+ const { placements } = serverRequest.data;
213
+ for (let i = 0, len = placements.length; i < len; i++) {
214
+ const placement = placements[i];
215
+ expect(placement.endpointId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']);
216
+ expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]);
217
+ expect(placement.bidId).to.be.a('string');
218
+ expect(placement.schain).to.be.an('object');
219
+ expect(placement.bidfloor).to.exist.and.to.equal(0);
220
+ expect(placement.type).to.exist.and.to.equal('network');
221
+ expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids);
151
222
 
152
223
  if (placement.adFormat === BANNER) {
153
224
  expect(placement.sizes).to.be.an('array');
@@ -174,6 +245,8 @@ describe('PGAMBidAdapter', function () {
174
245
  let data = serverRequest.data;
175
246
  expect(data.gdpr).to.exist;
176
247
  expect(data.gdpr).to.be.a('object');
248
+ expect(data.gdpr).to.have.property('consentString');
249
+ expect(data.gdpr).to.not.have.property('vendorData');
177
250
  expect(data.gdpr.consentString).to.equal(bidderRequest.gdprConsent.consentString);
178
251
  expect(data.ccpa).to.not.exist;
179
252
  delete bidderRequest.gdprConsent;
@@ -189,12 +262,6 @@ describe('PGAMBidAdapter', function () {
189
262
  expect(data.ccpa).to.equal(bidderRequest.uspConsent);
190
263
  expect(data.gdpr).to.not.exist;
191
264
  });
192
-
193
- it('Returns empty data if no valid requests are passed', function () {
194
- serverRequest = spec.buildRequests([], bidderRequest);
195
- let data = serverRequest.data;
196
- expect(data.placements).to.be.an('array').that.is.empty;
197
- });
198
265
  });
199
266
 
200
267
  describe('gpp consent', function () {
@@ -6,6 +6,16 @@ import { getUniqueIdentifierStr } from '../../../src/utils.js';
6
6
  const bidder = 'playdigo'
7
7
 
8
8
  describe('PlaydigoBidAdapter', function () {
9
+ const userIdAsEids = [{
10
+ source: 'test.org',
11
+ uids: [{
12
+ id: '01**********',
13
+ atype: 1,
14
+ ext: {
15
+ third: '01***********'
16
+ }
17
+ }]
18
+ }];
9
19
  const bids = [
10
20
  {
11
21
  bidId: getUniqueIdentifierStr(),
@@ -16,8 +26,9 @@ describe('PlaydigoBidAdapter', function () {
16
26
  }
17
27
  },
18
28
  params: {
19
- placementId: 'testBanner',
20
- }
29
+ placementId: 'testBanner'
30
+ },
31
+ userIdAsEids
21
32
  },
22
33
  {
23
34
  bidId: getUniqueIdentifierStr(),
@@ -30,8 +41,9 @@ describe('PlaydigoBidAdapter', function () {
30
41
  }
31
42
  },
32
43
  params: {
33
- placementId: 'testVideo',
34
- }
44
+ placementId: 'testVideo'
45
+ },
46
+ userIdAsEids
35
47
  },
36
48
  {
37
49
  bidId: getUniqueIdentifierStr(),
@@ -54,7 +66,8 @@ describe('PlaydigoBidAdapter', function () {
54
66
  },
55
67
  params: {
56
68
  placementId: 'testNative'
57
- }
69
+ },
70
+ userIdAsEids
58
71
  }
59
72
  ];
60
73
 
@@ -78,8 +91,17 @@ describe('PlaydigoBidAdapter', function () {
78
91
  vendorData: {}
79
92
  },
80
93
  refererInfo: {
81
- referer: 'https://test.com'
82
- }
94
+ referer: 'https://test.com',
95
+ page: 'https://test.com'
96
+ },
97
+ ortb2: {
98
+ device: {
99
+ w: 1512,
100
+ h: 982,
101
+ language: 'en-UK'
102
+ }
103
+ },
104
+ timeout: 500
83
105
  };
84
106
 
85
107
  describe('isBidRequestValid', function () {
@@ -105,6 +127,10 @@ describe('PlaydigoBidAdapter', function () {
105
127
  expect(serverRequest.method).to.equal('POST');
106
128
  });
107
129
 
130
+ it('Returns valid URL', function () {
131
+ expect(serverRequest.url).to.equal('https://server.playdigo.com/pbjs');
132
+ });
133
+
108
134
  it('Returns general data valid', function () {
109
135
  let data = serverRequest.data;
110
136
  expect(data).to.be.an('object');
@@ -143,6 +169,7 @@ describe('PlaydigoBidAdapter', function () {
143
169
  expect(placement.schain).to.be.an('object');
144
170
  expect(placement.bidfloor).to.exist.and.to.equal(0);
145
171
  expect(placement.type).to.exist.and.to.equal('publisher');
172
+ expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids);
146
173
 
147
174
  if (placement.adFormat === BANNER) {
148
175
  expect(placement.sizes).to.be.an('array');
@@ -175,9 +202,10 @@ describe('PlaydigoBidAdapter', function () {
175
202
  },
176
203
  params: {
177
204
  endpointId: 'testBanner',
178
- }
205
+ },
206
+ userIdAsEids
179
207
  }
180
- ]
208
+ ];
181
209
 
182
210
  let serverRequest = spec.buildRequests(bids, bidderRequest);
183
211
 
@@ -190,6 +218,7 @@ describe('PlaydigoBidAdapter', function () {
190
218
  expect(placement.schain).to.be.an('object');
191
219
  expect(placement.bidfloor).to.exist.and.to.equal(0);
192
220
  expect(placement.type).to.exist.and.to.equal('network');
221
+ expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids);
193
222
 
194
223
  if (placement.adFormat === BANNER) {
195
224
  expect(placement.sizes).to.be.an('array');
@@ -825,6 +825,20 @@ describe('S2S Adapter', function () {
825
825
  })
826
826
  })
827
827
  })
828
+
829
+ it('should set customHeaders correctly when publisher has provided it', () => {
830
+ let configWithCustomHeaders = utils.deepClone(CONFIG);
831
+ configWithCustomHeaders.customHeaders = { customHeader1: 'customHeader1Value' };
832
+ config.setConfig({ s2sConfig: configWithCustomHeaders });
833
+
834
+ let reqWithNewConfig = utils.deepClone(REQUEST);
835
+ reqWithNewConfig.s2sConfig = configWithCustomHeaders;
836
+
837
+ adapter.callBids(reqWithNewConfig, BID_REQUESTS, addBidResponse, done, ajax);
838
+ const reqHeaders = server.requests[0].requestHeaders
839
+ expect(reqHeaders.customHeader1).to.exist;
840
+ expect(reqHeaders.customHeader1).to.equal('customHeader1Value');
841
+ });
828
842
 
829
843
  it('should block request if config did not define p1Consent URL in endpoint object config', function () {
830
844
  let badConfig = utils.deepClone(CONFIG);