prebid.js 7.45.0 → 7.47.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 (204) 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/admaticBidAdapter.js +1 -1
  7. package/dist/adnuntiusBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adtrgtmeBidAdapter.js +1 -1
  10. package/dist/adxcgBidAdapter.js +1 -1
  11. package/dist/adyoulikeBidAdapter.js +1 -1
  12. package/dist/ajaBidAdapter.js +1 -1
  13. package/dist/amxBidAdapter.js +1 -1
  14. package/dist/amxIdSystem.js +1 -1
  15. package/dist/appierAnalyticsAdapter.js +1 -1
  16. package/dist/appnexusBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/axonixBidAdapter.js +1 -1
  19. package/dist/bidglassBidAdapter.js +1 -1
  20. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  21. package/dist/big-richmediaBidAdapter.js +1 -1
  22. package/dist/bridgewellBidAdapter.js +1 -1
  23. package/dist/brightMountainMediaBidAdapter.js +1 -1
  24. package/dist/carodaBidAdapter.js +1 -1
  25. package/dist/chtnwBidAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectadBidAdapter.js +1 -1
  28. package/dist/consumableBidAdapter.js +1 -1
  29. package/dist/conversantAnalyticsAdapter.js +1 -1
  30. package/dist/conversantBidAdapter.js +1 -1
  31. package/dist/craftBidAdapter.js +1 -1
  32. package/dist/criteoBidAdapter.js +1 -1
  33. package/dist/criteoIdSystem.js +1 -1
  34. package/dist/cwireBidAdapter.js +1 -1
  35. package/dist/debugging-standalone.js +1 -1
  36. package/dist/dependencies.json +3 -0
  37. package/dist/dspxBidAdapter.js +1 -1
  38. package/dist/emtvBidAdapter.js +1 -0
  39. package/dist/eplanningBidAdapter.js +1 -1
  40. package/dist/eskimiBidAdapter.js +1 -0
  41. package/dist/feedadBidAdapter.js +1 -1
  42. package/dist/finativeBidAdapter.js +1 -1
  43. package/dist/freewheel-sspBidAdapter.js +1 -1
  44. package/dist/glimpseBidAdapter.js +1 -1
  45. package/dist/gmosspBidAdapter.js +1 -1
  46. package/dist/goldbachBidAdapter.js +1 -1
  47. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  48. package/dist/gridBidAdapter.js +1 -1
  49. package/dist/gumgumBidAdapter.js +1 -1
  50. package/dist/h12mediaBidAdapter.js +1 -1
  51. package/dist/id5IdSystem.js +1 -1
  52. package/dist/improvedigitalBidAdapter.js +1 -1
  53. package/dist/inmarBidAdapter.js +1 -1
  54. package/dist/insticatorBidAdapter.js +1 -1
  55. package/dist/ixBidAdapter.js +1 -1
  56. package/dist/justpremiumBidAdapter.js +1 -1
  57. package/dist/kargoBidAdapter.js +1 -1
  58. package/dist/konduitAnalyticsAdapter.js +1 -1
  59. package/dist/kueezBidAdapter.js +1 -1
  60. package/dist/kueezRtbBidAdapter.js +1 -1
  61. package/dist/kulturemediaBidAdapter.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/magniteAnalyticsAdapter.js +1 -1
  68. package/dist/malltvAnalyticsAdapter.js +1 -1
  69. package/dist/marsmediaBidAdapter.js +1 -1
  70. package/dist/mediafuseBidAdapter.js +1 -1
  71. package/dist/mediasquareBidAdapter.js +1 -1
  72. package/dist/mgidBidAdapter.js +1 -1
  73. package/dist/minutemediaBidAdapter.js +1 -1
  74. package/dist/minutemediaplusBidAdapter.js +1 -1
  75. package/dist/missenaBidAdapter.js +1 -1
  76. package/dist/nativoBidAdapter.js +1 -1
  77. package/dist/neuwoRtdProvider.js +1 -1
  78. package/dist/nextMillenniumBidAdapter.js +1 -1
  79. package/dist/nexx360BidAdapter.js +1 -1
  80. package/dist/not-for-prod/prebid.js +137 -135
  81. package/dist/oguryBidAdapter.js +1 -1
  82. package/dist/onetagBidAdapter.js +1 -1
  83. package/dist/ooloAnalyticsAdapter.js +1 -1
  84. package/dist/optidigitalBidAdapter.js +1 -1
  85. package/dist/ortbConverter.js +1 -1
  86. package/dist/outbrainBidAdapter.js +1 -1
  87. package/dist/pairIdSystem.js +1 -0
  88. package/dist/parrableIdSystem.js +1 -1
  89. package/dist/pixfutureBidAdapter.js +1 -1
  90. package/dist/prebid-core.js +1 -1
  91. package/dist/publinkIdSystem.js +1 -1
  92. package/dist/pubmaticBidAdapter.js +1 -1
  93. package/dist/pubwiseAnalyticsAdapter.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/rtbhouseBidAdapter.js +1 -1
  101. package/dist/rubiconAnalyticsAdapter.js +1 -1
  102. package/dist/rubiconBidAdapter.js +1 -1
  103. package/dist/seedingAllianceBidAdapter.js +1 -1
  104. package/dist/seedtagBidAdapter.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/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/stvBidAdapter.js +1 -1
  117. package/dist/sublimeBidAdapter.js +1 -1
  118. package/dist/synacormediaBidAdapter.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/userId.js +1 -1
  129. package/dist/vidazooBidAdapter.js +1 -1
  130. package/dist/videobyteBidAdapter.js +1 -1
  131. package/dist/vidoomyBidAdapter.js +1 -1
  132. package/dist/visxBidAdapter.js +1 -1
  133. package/dist/vuukleBidAdapter.js +1 -1
  134. package/dist/widespaceBidAdapter.js +1 -1
  135. package/dist/winrBidAdapter.js +1 -1
  136. package/dist/yahoosspBidAdapter.js +1 -1
  137. package/dist/yieldmoBidAdapter.js +1 -1
  138. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  139. package/integrationExamples/gpt/fledge_example.html +103 -0
  140. package/integrationExamples/gpt/prebidServer_fledge_example.html +111 -0
  141. package/libraries/ortbConverter/processors/video.js +1 -0
  142. package/modules/admaticBidAdapter.js +7 -2
  143. package/modules/adnuntiusBidAdapter.js +3 -1
  144. package/modules/appnexusBidAdapter.js +108 -102
  145. package/modules/bidwatchAnalyticsAdapter.js +2 -0
  146. package/modules/conversantBidAdapter.js +3 -0
  147. package/modules/criteoBidAdapter.js +5 -1
  148. package/modules/criteoIdSystem.js +27 -14
  149. package/modules/emtvBidAdapter.js +211 -0
  150. package/modules/emtvBidAdapter.md +79 -0
  151. package/modules/eskimiBidAdapter.js +72 -0
  152. package/modules/eskimiBidAdapter.md +34 -0
  153. package/modules/gridBidAdapter.js +42 -19
  154. package/modules/ixBidAdapter.js +30 -0
  155. package/modules/kargoBidAdapter.js +473 -246
  156. package/modules/kueezRtbBidAdapter.js +16 -4
  157. package/modules/mediasquareBidAdapter.js +2 -1
  158. package/modules/minutemediaplusBidAdapter.js +16 -4
  159. package/modules/missenaBidAdapter.js +1 -1
  160. package/modules/nativoBidAdapter.js +110 -21
  161. package/modules/neuwoRtdProvider.js +0 -2
  162. package/modules/nextMillenniumBidAdapter.js +2 -0
  163. package/modules/pairIdSystem.js +79 -0
  164. package/modules/pubmaticBidAdapter.js +12 -9
  165. package/modules/rtbhouseBidAdapter.js +3 -3
  166. package/modules/userId/eids.js +6 -0
  167. package/modules/vidoomyBidAdapter.js +30 -9
  168. package/modules/vidoomyBidAdapter.md +12 -2
  169. package/modules/yieldmoBidAdapter.js +15 -5
  170. package/package.json +1 -1
  171. package/src/config.js +78 -127
  172. package/test/spec/modules/1plusXRtdProvider_spec.js +8 -7
  173. package/test/spec/modules/adagioBidAdapter_spec.js +0 -25
  174. package/test/spec/modules/admaticBidAdapter_spec.js +1 -1
  175. package/test/spec/modules/adnuntiusBidAdapter_spec.js +2 -1
  176. package/test/spec/modules/appnexusBidAdapter_spec.js +464 -448
  177. package/test/spec/modules/axonixBidAdapter_spec.js +0 -27
  178. package/test/spec/modules/big-richmediaBidAdapter_spec.js +68 -64
  179. package/test/spec/modules/conversantBidAdapter_spec.js +1 -0
  180. package/test/spec/modules/criteoBidAdapter_spec.js +33 -1
  181. package/test/spec/modules/criteoIdSystem_spec.js +99 -9
  182. package/test/spec/modules/emtvBidAdapter_spec.js +400 -0
  183. package/test/spec/modules/eskimiBidAdapter_spec.js +155 -0
  184. package/test/spec/modules/gridBidAdapter_spec.js +8 -0
  185. package/test/spec/modules/ixBidAdapter_spec.js +57 -0
  186. package/test/spec/modules/kargoBidAdapter_spec.js +297 -140
  187. package/test/spec/modules/kueezRtbBidAdapter_spec.js +22 -2
  188. package/test/spec/modules/minutemediaplusBidAdapter_spec.js +22 -2
  189. package/test/spec/modules/nativoBidAdapter_spec.js +101 -0
  190. package/test/spec/modules/neuwoRtdProvider_spec.js +0 -1
  191. package/test/spec/modules/ooloAnalyticsAdapter_spec.js +1 -1
  192. package/test/spec/modules/pairIdSystem_spec.js +68 -0
  193. package/test/spec/modules/pubCommonId_spec.js +0 -17
  194. package/test/spec/modules/pubmaticBidAdapter_spec.js +868 -867
  195. package/test/spec/modules/realvuAnalyticsAdapter_spec.js +0 -5
  196. package/test/spec/modules/rtbhouseBidAdapter_spec.js +2 -2
  197. package/test/spec/modules/vidoomyBidAdapter_spec.js +72 -0
  198. package/test/spec/modules/yieldmoBidAdapter_spec.js +19 -1
  199. package/test/spec/unit/pbjs_api_spec.js +19 -3
  200. package/test/test_index.js +13 -3
  201. package/dist/gridNMBidAdapter.js +0 -1
  202. package/modules/gridNMBidAdapter.js +0 -422
  203. package/modules/gridNMBidAdapter.md +0 -39
  204. package/test/spec/modules/gridNMBidAdapter_spec.js +0 -636
@@ -43,7 +43,12 @@ const BID = {
43
43
  'bidderWinsCount': 1,
44
44
  'requestId': 'b0777d85-d061-450e-9bc7-260dd54bbb7a',
45
45
  'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
46
- 'mediaTypes': [BANNER]
46
+ 'mediaTypes': [BANNER],
47
+ 'ortb2Imp': {
48
+ 'ext': {
49
+ 'gpid': '0123456789'
50
+ }
51
+ }
47
52
  };
48
53
 
49
54
  const VIDEO_BID = {
@@ -315,7 +320,8 @@ describe('KueezRtbBidAdapter', function () {
315
320
  protocols: [2, 3, 5, 6],
316
321
  startdelay: 0
317
322
  }
318
- }
323
+ },
324
+ gpid: ''
319
325
  }
320
326
  });
321
327
  });
@@ -373,6 +379,7 @@ describe('KueezRtbBidAdapter', function () {
373
379
  schain: BID.schain,
374
380
  res: `${window.top.screen.width}x${window.top.screen.height}`,
375
381
  mediaTypes: [BANNER],
382
+ gpid: '0123456789',
376
383
  uqs: getTopWindowQueryParams(),
377
384
  'ext.param1': 'loremipsum',
378
385
  'ext.param2': 'dolorsitamet',
@@ -448,6 +455,19 @@ describe('KueezRtbBidAdapter', function () {
448
455
  });
449
456
  });
450
457
 
458
+ it('should get meta from response metaData', function () {
459
+ const serverResponse = utils.deepClone(SERVER_RESPONSE);
460
+ serverResponse.body.results[0].metaData = {
461
+ advertiserDomains: ['kueezrtb.com'],
462
+ agencyName: 'Agency Name',
463
+ };
464
+ const responses = adapter.interpretResponse(serverResponse, REQUEST);
465
+ expect(responses[0].meta).to.deep.equal({
466
+ advertiserDomains: ['kueezrtb.com'],
467
+ agencyName: 'Agency Name'
468
+ });
469
+ });
470
+
451
471
  it('should return an array of interpreted video responses', function () {
452
472
  const responses = adapter.interpretResponse(VIDEO_SERVER_RESPONSE, REQUEST);
453
473
  expect(responses).to.have.length(1);
@@ -43,7 +43,12 @@ const BID = {
43
43
  'bidderWinsCount': 1,
44
44
  'requestId': 'b0777d85-d061-450e-9bc7-260dd54bbb7a',
45
45
  'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
46
- 'mediaTypes': [BANNER]
46
+ 'mediaTypes': [BANNER],
47
+ 'ortb2Imp': {
48
+ 'ext': {
49
+ 'gpid': '1234567890'
50
+ }
51
+ }
47
52
  };
48
53
 
49
54
  const VIDEO_BID = {
@@ -315,7 +320,8 @@ describe('MinuteMediaPlus Bid Adapter', function () {
315
320
  protocols: [2, 3, 5, 6],
316
321
  startdelay: 0
317
322
  }
318
- }
323
+ },
324
+ gpid: ''
319
325
  }
320
326
  });
321
327
  });
@@ -373,6 +379,7 @@ describe('MinuteMediaPlus Bid Adapter', function () {
373
379
  schain: BID.schain,
374
380
  res: `${window.top.screen.width}x${window.top.screen.height}`,
375
381
  mediaTypes: [BANNER],
382
+ gpid: '1234567890',
376
383
  uqs: getTopWindowQueryParams(),
377
384
  'ext.param1': 'loremipsum',
378
385
  'ext.param2': 'dolorsitamet',
@@ -448,6 +455,19 @@ describe('MinuteMediaPlus Bid Adapter', function () {
448
455
  });
449
456
  });
450
457
 
458
+ it('should get meta from response metaData', function () {
459
+ const serverResponse = utils.deepClone(SERVER_RESPONSE);
460
+ serverResponse.body.results[0].metaData = {
461
+ advertiserDomains: ['minutemedia-prebid.com'],
462
+ agencyName: 'Agency Name',
463
+ };
464
+ const responses = adapter.interpretResponse(serverResponse, REQUEST);
465
+ expect(responses[0].meta).to.deep.equal({
466
+ advertiserDomains: ['minutemedia-prebid.com'],
467
+ agencyName: 'Agency Name'
468
+ });
469
+ });
470
+
451
471
  it('should return an array of interpreted video responses', function () {
452
472
  const responses = adapter.interpretResponse(VIDEO_SERVER_RESPONSE, REQUEST);
453
473
  expect(responses).to.have.length(1);
@@ -8,6 +8,10 @@ import {
8
8
  getPageUrlFromBidRequest,
9
9
  hasProtocol,
10
10
  addProtocol,
11
+ BidRequestDataSource,
12
+ RequestData,
13
+ UserEIDs,
14
+ buildRequestUrl,
11
15
  } from '../../../modules/nativoBidAdapter'
12
16
 
13
17
  describe('bidDataMap', function () {
@@ -120,6 +124,7 @@ describe('nativoBidAdapterTests', function () {
120
124
  expect(request.url).to.be.a('string')
121
125
 
122
126
  expect(request.url).to.include('?')
127
+ expect(request.url).to.include('ntv_pbv')
123
128
  expect(request.url).to.include('ntv_ptd')
124
129
  expect(request.url).to.include('ntv_pb_rid')
125
130
  expect(request.url).to.include('ntv_ppc')
@@ -731,3 +736,99 @@ describe('getPageUrlFromBidRequest', () => {
731
736
  expect(url).not.to.be.undefined
732
737
  })
733
738
  })
739
+
740
+ describe('RequestData', () => {
741
+ describe('addBidRequestDataSource', () => {
742
+ it('Adds a BidRequestDataSource', () => {
743
+ const requestData = new RequestData()
744
+ const testBidRequestDataSource = new BidRequestDataSource()
745
+
746
+ requestData.addBidRequestDataSource(testBidRequestDataSource)
747
+
748
+ expect(requestData.bidRequestDataSources.length == 1)
749
+ })
750
+
751
+ it("Doeasn't add a non BidRequestDataSource", () => {
752
+ const requestData = new RequestData()
753
+
754
+ requestData.addBidRequestDataSource({})
755
+ requestData.addBidRequestDataSource('test')
756
+ requestData.addBidRequestDataSource(1)
757
+ requestData.addBidRequestDataSource(true)
758
+
759
+ expect(requestData.bidRequestDataSources.length == 0)
760
+ })
761
+ })
762
+
763
+ describe('getRequestDataString', () => {
764
+ it("Doesn't append empty query strings", () => {
765
+ const requestData = new RequestData()
766
+ const testBidRequestDataSource = new BidRequestDataSource()
767
+
768
+ requestData.addBidRequestDataSource(testBidRequestDataSource)
769
+
770
+ let qs = requestData.getRequestDataQueryString()
771
+ expect(qs).to.be.empty
772
+
773
+ testBidRequestDataSource.getRequestQueryString = () => {
774
+ return 'ntv_test=true'
775
+ }
776
+ qs = requestData.getRequestDataQueryString()
777
+ expect(qs).to.be.equal('ntv_test=true')
778
+ })
779
+ })
780
+ })
781
+
782
+ describe('UserEIDs', () => {
783
+ const userEids = new UserEIDs()
784
+ const eids = [{ 'testId': 1111 }]
785
+
786
+ describe('processBidRequestData', () => {
787
+ it('Processes bid request without eids', () => {
788
+ userEids.processBidRequestData({})
789
+
790
+ expect(userEids.eids).to.be.empty
791
+ })
792
+
793
+ it('Processed bid request with eids', () => {
794
+ userEids.processBidRequestData({ userIdAsEids: eids })
795
+
796
+ expect(userEids.eids).to.not.be.empty
797
+ })
798
+ })
799
+
800
+ describe('getRequestQueryString', () => {
801
+ it('Correctly prints out QS param string', () => {
802
+ const qs = userEids.getRequestQueryString()
803
+ const value = qs.slice(11)
804
+
805
+ expect(qs).to.include('ntv_pb_eid=')
806
+ try {
807
+ expect(JSON.parse(value)).to.be.equal(eids)
808
+ } catch (err) { }
809
+ })
810
+ })
811
+ })
812
+
813
+ describe('buildRequestUrl', () => {
814
+ const baseUrl = 'https://www.testExchange.com'
815
+ it('Returns baseUrl if no QS strings passed', () => {
816
+ const url = buildRequestUrl(baseUrl)
817
+ expect(url).to.be.equal(baseUrl)
818
+ })
819
+
820
+ it('Returns baseUrl if empty QS strings passed', () => {
821
+ const url = buildRequestUrl(baseUrl, ['', '', ''])
822
+ expect(url).to.be.equal(baseUrl)
823
+ })
824
+
825
+ it('Returns baseUrl + QS params if QS strings passed', () => {
826
+ const url = buildRequestUrl(baseUrl, ['ntv_ptd=123456&ntv_test=true', 'ntv_foo=bar'])
827
+ expect(url).to.be.equal(`${baseUrl}?ntv_ptd=123456&ntv_test=true&ntv_foo=bar`)
828
+ })
829
+
830
+ it('Returns baseUrl + QS params if mixed QS strings passed', () => {
831
+ const url = buildRequestUrl(baseUrl, ['ntv_ptd=123456&ntv_test=true', '', '', 'ntv_foo=bar'])
832
+ expect(url).to.be.equal(`${baseUrl}?ntv_ptd=123456&ntv_test=true&ntv_foo=bar`)
833
+ })
834
+ })
@@ -60,7 +60,6 @@ describe('neuwoRtdProvider', function () {
60
60
  neuwo.injectTopics(topics, bidsConfig, () => { })
61
61
  expect(bidsConfig.ortb2Fragments.global.site.content.data[0].name, 'name of first content data object').to.equal(neuwo.DATA_PROVIDER)
62
62
  expect(bidsConfig.ortb2Fragments.global.site.content.data[0].segment[0].id, 'id of first segment in content.data').to.equal(TAX_ID)
63
- expect(bidsConfig.ortb2Fragments.global.site.cattax, 'category taxonomy code for pagecat').to.equal(6) // CATTAX_IAB
64
63
  expect(bidsConfig.ortb2Fragments.global.site.pagecat[0], 'category taxonomy code for pagecat').to.equal(TAX_ID)
65
64
  })
66
65
 
@@ -194,7 +194,7 @@ describe('oolo Prebid Analytic', () => {
194
194
  })
195
195
 
196
196
  const conf = {}
197
- const pbjsConfig = config.getConfig()
197
+ const pbjsConfig = JSON.parse(JSON.stringify(config.getConfig()))
198
198
 
199
199
  Object.keys(pbjsConfig).forEach(key => {
200
200
  if (key[0] !== '_') {
@@ -0,0 +1,68 @@
1
+ import { storage, pairIdSubmodule } from 'modules/pairIdSystem.js';
2
+ import * as utils from 'src/utils.js';
3
+
4
+ describe('pairId', function () {
5
+ let sandbox;
6
+ let logErrorStub;
7
+
8
+ beforeEach(() => {
9
+ sandbox = sinon.sandbox.create();
10
+ logErrorStub = sandbox.stub(utils, 'logError');
11
+ });
12
+ afterEach(() => {
13
+ sandbox.restore();
14
+ });
15
+
16
+ it('should log an error if no ID is found when getId', function() {
17
+ pairIdSubmodule.getId({ params: {} });
18
+ expect(logErrorStub.calledOnce).to.be.true;
19
+ });
20
+
21
+ it('should read pairId from local storage if exists', function() {
22
+ let pairIds = ['test-pair-id1', 'test-pair-id2', 'test-pair-id3'];
23
+ sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('pairId').returns(btoa(JSON.stringify(pairIds)));
24
+
25
+ let id = pairIdSubmodule.getId({ params: {} });
26
+ expect(id).to.be.deep.equal({id: pairIds});
27
+ });
28
+
29
+ it('should read pairId from cookie if exists', function() {
30
+ let pairIds = ['test-pair-id4', 'test-pair-id5', 'test-pair-id6'];
31
+ sandbox.stub(storage, 'getCookie').withArgs('pairId').returns(btoa(JSON.stringify(pairIds)));
32
+
33
+ let id = pairIdSubmodule.getId({ params: {} });
34
+ expect(id).to.be.deep.equal({id: pairIds});
35
+ });
36
+
37
+ it('should read pairId from default liveramp envelope local storage key if configured', function() {
38
+ let pairIds = ['test-pair-id1', 'test-pair-id2', 'test-pair-id3'];
39
+ sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('_lr_pairId').returns(btoa(JSON.stringify({'envelope': pairIds})));
40
+ let id = pairIdSubmodule.getId({
41
+ params: {
42
+ liveramp: {}
43
+ }})
44
+ expect(id).to.be.deep.equal({id: pairIds})
45
+ })
46
+
47
+ it('should read pairId from default liveramp envelope cookie entry if configured', function() {
48
+ let pairIds = ['test-pair-id4', 'test-pair-id5', 'test-pair-id6'];
49
+ sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('_lr_pairId').returns(btoa(JSON.stringify({'envelope': pairIds})));
50
+ let id = pairIdSubmodule.getId({
51
+ params: {
52
+ liveramp: {}
53
+ }})
54
+ expect(id).to.be.deep.equal({id: pairIds})
55
+ })
56
+
57
+ it('should read pairId from specified liveramp envelope cookie entry if configured with storageKey', function() {
58
+ let pairIds = ['test-pair-id7', 'test-pair-id8', 'test-pair-id9'];
59
+ sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('lr_pairId_custom').returns(btoa(JSON.stringify({'envelope': pairIds})));
60
+ let id = pairIdSubmodule.getId({
61
+ params: {
62
+ liveramp: {
63
+ storageKey: 'lr_pairId_custom'
64
+ }
65
+ }})
66
+ expect(id).to.be.deep.equal({id: pairIds})
67
+ })
68
+ });
@@ -233,23 +233,6 @@ describe('Publisher Common ID', function () {
233
233
  });
234
234
  });
235
235
  });
236
-
237
- it.skip('disable auto create', function() {
238
- setConfig({
239
- create: false
240
- });
241
-
242
- const config = getPubcidConfig();
243
- expect(config.create).to.be.false;
244
- expect(config.typeEnabled).to.equal('html5');
245
-
246
- let adUnits = getAdUnits();
247
- let innerAdUnits;
248
- requestBidHook((config) => { innerAdUnits = config.adUnits }, {adUnits});
249
-
250
- const pubcid = localStorage.getItem(ID_NAME);
251
- expect(pubcid).to.be.null;
252
- });
253
236
  });
254
237
 
255
238
  describe('Invoking requestBid', function () {