prebid.js 8.45.0 → 8.46.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 (203) hide show
  1. package/dist/33acrossAnalyticsAdapter.js +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/BTBidAdapter.js +1 -1
  5. package/dist/adagioAnalyticsAdapter.js +1 -1
  6. package/dist/adagioBidAdapter.js +1 -1
  7. package/dist/adbookpspBidAdapter.js +1 -1
  8. package/dist/adgenerationBidAdapter.js +1 -1
  9. package/dist/adnuntiusBidAdapter.js +1 -1
  10. package/dist/adqueryBidAdapter.js +1 -1
  11. package/dist/adrelevantisBidAdapter.js +1 -1
  12. package/dist/adstirBidAdapter.js +1 -1
  13. package/dist/adtrgtmeBidAdapter.js +1 -1
  14. package/dist/adxcgBidAdapter.js +1 -1
  15. package/dist/adyoulikeBidAdapter.js +1 -1
  16. package/dist/agmaAnalyticsAdapter.js +1 -1
  17. package/dist/ajaBidAdapter.js +1 -1
  18. package/dist/alkimiBidAdapter.js +1 -1
  19. package/dist/amxBidAdapter.js +1 -1
  20. package/dist/amxIdSystem.js +1 -1
  21. package/dist/appierAnalyticsAdapter.js +1 -1
  22. package/dist/appnexusBidAdapter.js +1 -1
  23. package/dist/asoBidAdapter.js +1 -1
  24. package/dist/axonixBidAdapter.js +1 -1
  25. package/dist/bidglassBidAdapter.js +1 -1
  26. package/dist/big-richmediaBidAdapter.js +1 -1
  27. package/dist/bridBidAdapter.js +1 -1
  28. package/dist/bridgewellBidAdapter.js +1 -1
  29. package/dist/brightMountainMediaBidAdapter.js +1 -1
  30. package/dist/carodaBidAdapter.js +1 -1
  31. package/dist/chtnwBidAdapter.js +1 -1
  32. package/dist/chunk-core.js +1 -1
  33. package/dist/concertBidAdapter.js +1 -1
  34. package/dist/connectadBidAdapter.js +1 -1
  35. package/dist/consumableBidAdapter.js +1 -1
  36. package/dist/conversantAnalyticsAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/cwireBidAdapter.js +1 -1
  41. package/dist/dependencies.json +12 -3
  42. package/dist/dspxBidAdapter.js +1 -1
  43. package/dist/dxkultureBidAdapter.js +1 -1
  44. package/dist/engageyaBidAdapter.js +1 -1
  45. package/dist/eplanningBidAdapter.js +1 -1
  46. package/dist/euidIdSystem.js +1 -1
  47. package/dist/feedadBidAdapter.js +1 -1
  48. package/dist/finativeBidAdapter.js +1 -1
  49. package/dist/freewheel-sspBidAdapter.js +1 -1
  50. package/dist/gmosspBidAdapter.js +1 -1
  51. package/dist/goldbachBidAdapter.js +1 -1
  52. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  53. package/dist/greenbidsRtdProvider.js +1 -1
  54. package/dist/gridBidAdapter.js +1 -1
  55. package/dist/gumgumBidAdapter.js +1 -1
  56. package/dist/h12mediaBidAdapter.js +1 -1
  57. package/dist/hypelabBidAdapter.js +1 -1
  58. package/dist/id5IdSystem.js +1 -1
  59. package/dist/illuminBidAdapter.js +1 -1
  60. package/dist/imdsBidAdapter.js +1 -1
  61. package/dist/improvedigitalBidAdapter.js +1 -1
  62. package/dist/insticatorBidAdapter.js +1 -1
  63. package/dist/ixBidAdapter.js +1 -1
  64. package/dist/jixieBidAdapter.js +1 -1
  65. package/dist/justpremiumBidAdapter.js +1 -1
  66. package/dist/jwplayerBidAdapter.js +1 -0
  67. package/dist/kargoBidAdapter.js +1 -1
  68. package/dist/kimberliteBidAdapter.js +1 -1
  69. package/dist/konduitAnalyticsAdapter.js +1 -1
  70. package/dist/kueezBidAdapter.js +1 -1
  71. package/dist/kueezRtbBidAdapter.js +1 -1
  72. package/dist/lassoBidAdapter.js +1 -1
  73. package/dist/lifestreetBidAdapter.js +1 -1
  74. package/dist/liveIntentIdSystem.js +1 -1
  75. package/dist/logicadBidAdapter.js +1 -1
  76. package/dist/loglyliftBidAdapter.js +1 -1
  77. package/dist/luceadBidAdapter.js +1 -1
  78. package/dist/magniteAnalyticsAdapter.js +1 -1
  79. package/dist/malltvAnalyticsAdapter.js +1 -1
  80. package/dist/marsmediaBidAdapter.js +1 -1
  81. package/dist/mediafuseBidAdapter.js +1 -1
  82. package/dist/mediasquareBidAdapter.js +1 -1
  83. package/dist/mgidBidAdapter.js +1 -1
  84. package/dist/minutemediaBidAdapter.js +1 -1
  85. package/dist/minutemediaplusBidAdapter.js +1 -1
  86. package/dist/missenaBidAdapter.js +1 -1
  87. package/dist/nexx360BidAdapter.js +1 -1
  88. package/dist/not-for-prod/prebid.js +154 -152
  89. package/dist/oguryBidAdapter.js +1 -1
  90. package/dist/onetagBidAdapter.js +1 -1
  91. package/dist/ooloAnalyticsAdapter.js +1 -1
  92. package/dist/openwebBidAdapter.js +1 -1
  93. package/dist/openxBidAdapter.js +1 -1
  94. package/dist/optableBidAdapter.js +1 -0
  95. package/dist/optidigitalBidAdapter.js +1 -1
  96. package/dist/ortbConverter.js +1 -1
  97. package/dist/outbrainBidAdapter.js +1 -1
  98. package/dist/parrableIdSystem.js +1 -1
  99. package/dist/pixfutureBidAdapter.js +1 -1
  100. package/dist/publinkIdSystem.js +1 -1
  101. package/dist/publirBidAdapter.js +1 -1
  102. package/dist/pubmaticBidAdapter.js +1 -1
  103. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  104. package/dist/pxyzBidAdapter.js +1 -1
  105. package/dist/quantcastBidAdapter.js +1 -1
  106. package/dist/readpeakBidAdapter.js +1 -1
  107. package/dist/relaidoBidAdapter.js +1 -1
  108. package/dist/retailspotBidAdapter.js +1 -1
  109. package/dist/rhythmoneBidAdapter.js +1 -1
  110. package/dist/riseBidAdapter.js +1 -1
  111. package/dist/rubiconBidAdapter.js +1 -1
  112. package/dist/seedingAllianceBidAdapter.js +1 -1
  113. package/dist/seedtagBidAdapter.js +1 -1
  114. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  115. package/dist/sharethroughBidAdapter.js +1 -1
  116. package/dist/shinezBidAdapter.js +1 -1
  117. package/dist/shinezRtbBidAdapter.js +1 -1
  118. package/dist/sirdataRtdProvider.js +1 -1
  119. package/dist/smaatoBidAdapter.js +1 -1
  120. package/dist/smartadserverBidAdapter.js +1 -1
  121. package/dist/smartxBidAdapter.js +1 -1
  122. package/dist/smilewantedBidAdapter.js +1 -1
  123. package/dist/sonobiBidAdapter.js +1 -1
  124. package/dist/sovrnAnalyticsAdapter.js +1 -1
  125. package/dist/sovrnBidAdapter.js +1 -1
  126. package/dist/sspBCBidAdapter.js +1 -1
  127. package/dist/stnBidAdapter.js +1 -1
  128. package/dist/stroeerCoreBidAdapter.js +1 -1
  129. package/dist/stvBidAdapter.js +1 -1
  130. package/dist/sublimeBidAdapter.js +1 -1
  131. package/dist/taboolaBidAdapter.js +1 -1
  132. package/dist/tagorasBidAdapter.js +1 -1
  133. package/dist/targetVideoBidAdapter.js +1 -1
  134. package/dist/teadsBidAdapter.js +1 -1
  135. package/dist/themoneytizerBidAdapter.js +1 -1
  136. package/dist/trionBidAdapter.js +1 -1
  137. package/dist/tripleliftBidAdapter.js +1 -1
  138. package/dist/ttdBidAdapter.js +1 -1
  139. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  140. package/dist/uid2IdSystem.js +1 -1
  141. package/dist/underdogmediaBidAdapter.js +1 -1
  142. package/dist/undertoneBidAdapter.js +1 -1
  143. package/dist/unrulyBidAdapter.js +1 -1
  144. package/dist/viantOrtbBidAdapter.js +1 -1
  145. package/dist/vidazooBidAdapter.js +1 -1
  146. package/dist/videobyteBidAdapter.js +1 -1
  147. package/dist/visxBidAdapter.js +1 -1
  148. package/dist/vuukleBidAdapter.js +1 -1
  149. package/dist/widespaceBidAdapter.js +1 -1
  150. package/dist/winrBidAdapter.js +1 -1
  151. package/dist/yahoosspBidAdapter.js +1 -1
  152. package/dist/yandexAnalyticsAdapter.js +1 -1
  153. package/dist/yieldmoBidAdapter.js +1 -1
  154. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  155. package/integrationExamples/noadserver/jwplayerBidAdapter_sample.html +75 -0
  156. package/integrationExamples/realTimeData/jwplayerRtdProvider_example.html +7 -0
  157. package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +7 -0
  158. package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +9 -4
  159. package/integrationExamples/videoModule/jwplayer/bidsBackHandlerOverride.html +7 -0
  160. package/integrationExamples/videoModule/jwplayer/eventListeners.html +7 -0
  161. package/integrationExamples/videoModule/jwplayer/eventsUI.html +7 -0
  162. package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +7 -0
  163. package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +7 -0
  164. package/integrationExamples/videoModule/jwplayer/playlist.html +7 -0
  165. package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +7 -0
  166. package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +7 -0
  167. package/integrationExamples/videoModule/videojs/bidsBackHandlerOverride.html +7 -0
  168. package/integrationExamples/videoModule/videojs/eventListeners.html +7 -0
  169. package/integrationExamples/videoModule/videojs/eventsUI.html +7 -0
  170. package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +7 -0
  171. package/integrationExamples/videoModule/videojs/mediaMetadata.html +7 -0
  172. package/integrationExamples/videoModule/videojs/playlist.html +7 -0
  173. package/libraries/ortbConverter/processors/banner.js +2 -2
  174. package/modules/adgenerationBidAdapter.js +6 -10
  175. package/modules/adnuntiusBidAdapter.js +5 -0
  176. package/modules/alkimiBidAdapter.js +48 -8
  177. package/modules/engageyaBidAdapter.js +1 -1
  178. package/modules/gumgumBidAdapter.js +1 -1
  179. package/modules/jwplayerBidAdapter.js +412 -0
  180. package/modules/jwplayerBidAdapter.md +72 -0
  181. package/modules/optableBidAdapter.js +42 -0
  182. package/modules/optableBidAdapter.md +41 -0
  183. package/modules/optidigitalBidAdapter.js +20 -4
  184. package/modules/pubmaticBidAdapter.js +21 -1
  185. package/modules/relaidoBidAdapter.js +70 -9
  186. package/modules/sirdataRtdProvider.js +33 -43
  187. package/modules/stroeerCoreBidAdapter.js +7 -5
  188. package/modules/viantOrtbBidAdapter.js +2 -0
  189. package/modules/yandexAnalyticsAdapter.js +6 -0
  190. package/package.json +1 -1
  191. package/src/utils.js +15 -2
  192. package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
  193. package/test/spec/modules/adnuntiusBidAdapter_spec.js +18 -1
  194. package/test/spec/modules/alkimiBidAdapter_spec.js +11 -5
  195. package/test/spec/modules/gumgumBidAdapter_spec.js +1 -1
  196. package/test/spec/modules/jwplayerBidAdapter_spec.js +412 -0
  197. package/test/spec/modules/liveIntentIdSystem_spec.js +13 -15
  198. package/test/spec/modules/optableBidAdapter_spec.js +89 -0
  199. package/test/spec/modules/optidigitalBidAdapter_spec.js +34 -4
  200. package/test/spec/modules/pubmaticBidAdapter_spec.js +24 -1
  201. package/test/spec/modules/relaidoBidAdapter_spec.js +62 -0
  202. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +21 -0
  203. package/test/spec/utils_spec.js +17 -1
@@ -423,7 +423,32 @@ describe('optidigitalAdapterTests', function () {
423
423
  bidderRequest.uspConsent = '1YYY';
424
424
  const request = spec.buildRequests(validBidRequests, bidderRequest);
425
425
  const payload = JSON.parse(request.data);
426
- expect(payload.uspConsent).to.exist;
426
+ expect(payload.us_privacy).to.exist;
427
+ });
428
+
429
+ it('should send gppConsent to given endpoint where there is gppConsent', function() {
430
+ let consentString = 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==';
431
+ bidderRequest.gppConsent = {
432
+ 'gppString': consentString,
433
+ 'applicableSections': [7]
434
+ };
435
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
436
+ const payload = JSON.parse(request.data);
437
+ expect(payload.gpp).to.exist;
438
+ });
439
+
440
+ it('should send gppConsent to given endpoint when there is gpp in ortb2', function() {
441
+ let consentString = 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==';
442
+ bidderRequest.gppConsent = undefined;
443
+ bidderRequest.ortb2 = {
444
+ regs: {
445
+ gpp: consentString,
446
+ gpp_sid: [7]
447
+ }
448
+ }
449
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
450
+ const payload = JSON.parse(request.data);
451
+ expect(payload.gpp).to.exist;
427
452
  });
428
453
 
429
454
  it('should use appropriate mediaTypes banner sizes', function() {
@@ -546,9 +571,14 @@ describe('optidigitalAdapterTests', function () {
546
571
  type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=`
547
572
  }]);
548
573
  });
549
- it('should return appropriate URL with GDPR equals to 1, GDPR consent and CCPA consent', function() {
550
- expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, {consentString: 'fooUsp'})).to.deep.equal([{
551
- type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&ccpa_consent=fooUsp`
574
+ it('should return appropriate URL with GDPR equals to 1, GDPR consent and US Privacy consent', function() {
575
+ expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, 'fooUsp')).to.deep.equal([{
576
+ type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&us_privacy=fooUsp`
577
+ }]);
578
+ });
579
+ it('should return appropriate URL with GDPR equals to 1, GDPR consent, US Privacy consent and GPP consent', function() {
580
+ expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, 'fooUsp', {gppString: 'fooGpp', applicableSections: [7]})).to.deep.equal([{
581
+ type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&us_privacy=fooUsp&gpp=fooGpp&gpp_sid=7`
552
582
  }]);
553
583
  });
554
584
  });
@@ -1,5 +1,5 @@
1
1
  import { expect } from 'chai';
2
- import { spec, checkVideoPlacement, _getDomainFromURL, assignDealTier, prepareMetaObject } from 'modules/pubmaticBidAdapter.js';
2
+ import { spec, checkVideoPlacement, _getDomainFromURL, assignDealTier, prepareMetaObject, getDeviceConnectionType } from 'modules/pubmaticBidAdapter.js';
3
3
  import * as utils from 'src/utils.js';
4
4
  import { config } from 'src/config.js';
5
5
  import { createEidsArray } from 'modules/userId/eids.js';
@@ -2964,6 +2964,14 @@ describe('PubMatic adapter', function () {
2964
2964
  expect(data.imp[0].ext.ae).to.equal(1);
2965
2965
  });
2966
2966
  });
2967
+
2968
+ it('should send connectiontype parameter if browser contains navigator.connection property', function () {
2969
+ const bidRequest = spec.buildRequests(bidRequests);
2970
+ let data = JSON.parse(bidRequest.data);
2971
+ if (window.navigator && window.navigator.connection) {
2972
+ expect(data.device).to.include.any.keys('connectiontype');
2973
+ }
2974
+ });
2967
2975
  });
2968
2976
 
2969
2977
  it('Request params dctr check', function () {
@@ -4020,6 +4028,21 @@ describe('PubMatic adapter', function () {
4020
4028
  });
4021
4029
  });
4022
4030
 
4031
+ describe('getDeviceConnectionType', function() {
4032
+ it('is a function', function(done) {
4033
+ getDeviceConnectionType.should.be.a('function');
4034
+ done();
4035
+ });
4036
+
4037
+ it('should return matched value if navigator.connection is present', function(done) {
4038
+ const connectionValue = getDeviceConnectionType();
4039
+ if (window?.navigator?.connection) {
4040
+ expect(connectionValue).to.be.a('number');
4041
+ }
4042
+ done();
4043
+ });
4044
+ });
4045
+
4023
4046
  if (FEATURES.VIDEO) {
4024
4047
  describe('Checking for Video.Placement property', function() {
4025
4048
  let sandbox, utilsMock;
@@ -3,6 +3,7 @@ import {spec} from 'modules/relaidoBidAdapter.js';
3
3
  import * as utils from 'src/utils.js';
4
4
  import {VIDEO} from 'src/mediaTypes.js';
5
5
  import {getCoreStorageManager} from '../../../src/storageManager.js';
6
+ import * as mockGpt from '../integration/faker/googletag.js';
6
7
 
7
8
  const UUID_KEY = 'relaido_uuid';
8
9
  const relaido_uuid = 'hogehoge';
@@ -15,14 +16,18 @@ describe('RelaidoAdapter', function () {
15
16
  let serverRequest;
16
17
  let generateUUIDStub;
17
18
  let triggerPixelStub;
19
+ let sandbox;
20
+
18
21
  before(() => {
19
22
  const storage = getCoreStorageManager();
20
23
  storage.setCookie(UUID_KEY, relaido_uuid);
21
24
  });
22
25
 
23
26
  beforeEach(function () {
27
+ mockGpt.disable();
24
28
  generateUUIDStub = sinon.stub(utils, 'generateUUID').returns(relaido_uuid);
25
29
  triggerPixelStub = sinon.stub(utils, 'triggerPixel');
30
+ sandbox = sinon.sandbox.create();
26
31
  bidRequest = {
27
32
  bidder: 'relaido',
28
33
  params: {
@@ -115,6 +120,7 @@ describe('RelaidoAdapter', function () {
115
120
  afterEach(() => {
116
121
  generateUUIDStub.restore();
117
122
  triggerPixelStub.restore();
123
+ sandbox.restore();
118
124
  });
119
125
 
120
126
  describe('spec.isBidRequestValid', function () {
@@ -251,8 +257,10 @@ describe('RelaidoAdapter', function () {
251
257
  expect(request.bid_id).to.equal(bidRequest.bidId);
252
258
  expect(request.transaction_id).to.equal(bidRequest.ortb2Imp.ext.tid);
253
259
  expect(request.media_type).to.equal('video');
260
+ expect(request.pagekvt).to.deep.equal({});
254
261
  expect(data.uuid).to.equal(relaido_uuid);
255
262
  expect(data.pv).to.equal('$prebid.version$');
263
+ expect(request.userIdAsEids).to.be.an('array');
256
264
  });
257
265
 
258
266
  it('should build bid requests by banner', function () {
@@ -335,6 +343,60 @@ describe('RelaidoAdapter', function () {
335
343
  expect(data.bids[0].userIdAsEids).to.have.lengthOf(1);
336
344
  expect(data.bids[0].userIdAsEids[0].source).to.equal('hogehoge.com');
337
345
  });
346
+
347
+ it('should get pagekvt', function () {
348
+ mockGpt.enable();
349
+ window.googletag.pubads().clearTargeting();
350
+ window.googletag.pubads().setTargeting('testkey', ['testvalue']);
351
+ bidRequest.adUnitCode = 'test-adunit-code-1';
352
+ window.googletag.pubads().setSlots([mockGpt.makeSlot({ code: bidRequest.adUnitCode })]);
353
+ const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
354
+ const data = JSON.parse(bidRequests.data);
355
+ expect(data.bids).to.have.lengthOf(1);
356
+ const request = data.bids[0];
357
+ expect(request.pagekvt).to.deep.equal({testkey: ['testvalue']});
358
+ });
359
+
360
+ it('should get canonicalUrl (ogUrl:true)', function () {
361
+ bidRequest.params.ogUrl = true;
362
+ bidderRequest.refererInfo.canonicalUrl = null;
363
+ let documentStub = sandbox.stub(window.top.document, 'querySelector');
364
+ documentStub.withArgs('meta[property="og:url"]').returns({
365
+ content: 'http://localhost:9999/fb-test'
366
+ });
367
+ const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
368
+ const data = JSON.parse(bidRequests.data);
369
+ expect(data.bids).to.have.lengthOf(1);
370
+ expect(data.canonical_url).to.equal('http://localhost:9999/fb-test');
371
+ expect(data.canonical_url_hash).to.equal('cd106829f866d60ee4ed43c6e2a5d0a5212ffc97');
372
+ });
373
+
374
+ it('should not get canonicalUrl (ogUrl:false)', function () {
375
+ bidRequest.params.ogUrl = false;
376
+ bidderRequest.refererInfo.canonicalUrl = null;
377
+ let documentStub = sandbox.stub(window.top.document, 'querySelector');
378
+ documentStub.withArgs('meta[property="og:url"]').returns({
379
+ content: 'http://localhost:9999/fb-test'
380
+ });
381
+ const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
382
+ const data = JSON.parse(bidRequests.data);
383
+ expect(data.bids).to.have.lengthOf(1);
384
+ expect(data.canonical_url).to.be.null;
385
+ expect(data.canonical_url_hash).to.be.null;
386
+ });
387
+
388
+ it('should not get canonicalUrl (ogUrl:nothing)', function () {
389
+ bidderRequest.refererInfo.canonicalUrl = null;
390
+ let documentStub = sandbox.stub(window.top.document, 'querySelector');
391
+ documentStub.withArgs('meta[property="og:url"]').returns({
392
+ content: 'http://localhost:9999/fb-test'
393
+ });
394
+ const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
395
+ const data = JSON.parse(bidRequests.data);
396
+ expect(data.bids).to.have.lengthOf(1);
397
+ expect(data.canonical_url).to.be.null;
398
+ expect(data.canonical_url_hash).to.be.null;
399
+ });
338
400
  });
339
401
 
340
402
  describe('spec.interpretResponse', function () {
@@ -877,6 +877,27 @@ describe('stroeerCore bid adapter', function () {
877
877
 
878
878
  assert.deepEqual(sentOrtb2, ortb2);
879
879
  });
880
+
881
+ it('should add the Cookie Deprecation Label', () => {
882
+ const bidReq = buildBidderRequest();
883
+
884
+ const cDepObj = {
885
+ cdep: 'example_label_1'
886
+ };
887
+
888
+ const ortb2 = {
889
+ device: {
890
+ ext: cDepObj
891
+ }
892
+ };
893
+
894
+ bidReq.ortb2 = utils.deepClone(ortb2);
895
+
896
+ const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq);
897
+ const sentOrtb2 = serverRequestInfo.data.ortb2;
898
+
899
+ assert.deepEqual(sentOrtb2, ortb2);
900
+ });
880
901
  });
881
902
  });
882
903
  });
@@ -3,7 +3,7 @@ import {expect} from 'chai';
3
3
  import { TARGETING_KEYS } from 'src/constants.js';
4
4
  import * as utils from 'src/utils.js';
5
5
  import {getHighestCpm, getLatestHighestCpmBid, getOldestHighestCpmBid} from '../../src/utils/reducers.js';
6
- import {binarySearch, deepEqual, memoize, waitForElementToLoad} from 'src/utils.js';
6
+ import {binarySearch, deepEqual, encodeMacroURI, memoize, waitForElementToLoad} from 'src/utils.js';
7
7
  import {convertCamelToUnderscore} from '../../libraries/appnexusUtils/anUtils.js';
8
8
 
9
9
  var assert = require('assert');
@@ -778,6 +778,22 @@ describe('Utils', function () {
778
778
  expect(parsed.search).to.equal('?search=test&foo=bar&bar=foo&foo=xxx');
779
779
  });
780
780
  });
781
+
782
+ describe('encodeMacroURI', () => {
783
+ [
784
+ ['https://www.example.com', 'https://www.example.com'],
785
+ ['https://www.example/${MACRO}', 'https://www.example/${MACRO}'],
786
+ ['http://www.example/è', `http://www.example/${encodeURIComponent('è')}`],
787
+ ['https://www.${MACRO_1}/${MACRO_1}/${MACRO_2}è', 'https://www.${MACRO_1}/${MACRO_1}/${MACRO_2}' + encodeURIComponent('è')],
788
+ ['http://${MACRO}${MACRO}/${MACRO}', 'http://${MACRO}${MACRO}/${MACRO}'],
789
+ ['{MACRO}${MACRO}', `${encodeURIComponent('{MACRO}')}\${MACRO}`],
790
+ ['https://www.example.com?p=${AUCTION_PRICE}', 'https://www.example.com?p=${AUCTION_PRICE}']
791
+ ].forEach(([input, expected]) => {
792
+ it(`can encode ${input} -> ${expected}`, () => {
793
+ expect(encodeMacroURI(input)).to.eql(expected);
794
+ })
795
+ })
796
+ })
781
797
  });
782
798
 
783
799
  describe('insertElement', function () {