prebid.js 7.31.0 → 7.32.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 (180) 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/adlooxRtdProvider.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/aidemBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/alkimiBidAdapter.js +1 -1
  13. package/dist/amxBidAdapter.js +1 -1
  14. package/dist/amxIdSystem.js +1 -1
  15. package/dist/aolBidAdapter.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/appushBidAdapter.js +1 -0
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/carodaBidAdapter.js +1 -1
  26. package/dist/chtnwBidAdapter.js +1 -1
  27. package/dist/concertBidAdapter.js +1 -1
  28. package/dist/connectIdSystem.js +1 -1
  29. package/dist/connectadBidAdapter.js +1 -1
  30. package/dist/consumableBidAdapter.js +1 -1
  31. package/dist/conversantBidAdapter.js +1 -1
  32. package/dist/craftBidAdapter.js +1 -1
  33. package/dist/criteoBidAdapter.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/eplanningBidAdapter.js +1 -1
  36. package/dist/feedadBidAdapter.js +1 -1
  37. package/dist/finativeBidAdapter.js +1 -1
  38. package/dist/glimpseBidAdapter.js +1 -1
  39. package/dist/gmosspBidAdapter.js +1 -1
  40. package/dist/goldbachBidAdapter.js +1 -1
  41. package/dist/gridBidAdapter.js +1 -1
  42. package/dist/gridNMBidAdapter.js +1 -1
  43. package/dist/gumgumBidAdapter.js +1 -1
  44. package/dist/h12mediaBidAdapter.js +1 -1
  45. package/dist/holidBidAdapter.js +1 -0
  46. package/dist/id5IdSystem.js +1 -1
  47. package/dist/improvedigitalBidAdapter.js +1 -1
  48. package/dist/inmarBidAdapter.js +1 -1
  49. package/dist/insticatorBidAdapter.js +1 -1
  50. package/dist/ixBidAdapter.js +1 -1
  51. package/dist/justpremiumBidAdapter.js +1 -1
  52. package/dist/jwplayerVideoProvider.js +1 -1
  53. package/dist/konduitAnalyticsAdapter.js +1 -1
  54. package/dist/kueezBidAdapter.js +1 -1
  55. package/dist/kueezRtbBidAdapter.js +1 -1
  56. package/dist/lassoBidAdapter.js +1 -1
  57. package/dist/lifestreetBidAdapter.js +1 -1
  58. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  59. package/dist/logicadBidAdapter.js +1 -1
  60. package/dist/loglyliftBidAdapter.js +1 -1
  61. package/dist/magniteAnalyticsAdapter.js +1 -1
  62. package/dist/malltvAnalyticsAdapter.js +1 -1
  63. package/dist/marsmediaBidAdapter.js +1 -1
  64. package/dist/mediafuseBidAdapter.js +1 -1
  65. package/dist/medianetRtdProvider.js +1 -1
  66. package/dist/mediasquareBidAdapter.js +1 -1
  67. package/dist/mgidBidAdapter.js +1 -1
  68. package/dist/minutemediaBidAdapter.js +1 -1
  69. package/dist/nexx360BidAdapter.js +1 -1
  70. package/dist/not-for-prod/prebid.js +126 -123
  71. package/dist/oguryBidAdapter.js +1 -1
  72. package/dist/onetagBidAdapter.js +1 -1
  73. package/dist/ooloAnalyticsAdapter.js +1 -1
  74. package/dist/orbitsoftBidAdapter.js +1 -0
  75. package/dist/outbrainBidAdapter.js +1 -1
  76. package/dist/parrableIdSystem.js +1 -1
  77. package/dist/permutiveRtdProvider.js +1 -1
  78. package/dist/pixfutureBidAdapter.js +1 -1
  79. package/dist/prebid-core.js +1 -1
  80. package/dist/publinkIdSystem.js +1 -1
  81. package/dist/pubmaticBidAdapter.js +1 -1
  82. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  83. package/dist/pxyzBidAdapter.js +1 -1
  84. package/dist/quantcastBidAdapter.js +1 -1
  85. package/dist/readpeakBidAdapter.js +1 -1
  86. package/dist/relaidoBidAdapter.js +1 -1
  87. package/dist/rhythmoneBidAdapter.js +1 -1
  88. package/dist/riseBidAdapter.js +1 -1
  89. package/dist/rubiconAnalyticsAdapter.js +1 -1
  90. package/dist/rubiconBidAdapter.js +1 -1
  91. package/dist/seedingAllianceBidAdapter.js +1 -1
  92. package/dist/seedtagBidAdapter.js +1 -1
  93. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  94. package/dist/sharethroughBidAdapter.js +1 -1
  95. package/dist/shinezBidAdapter.js +1 -1
  96. package/dist/smaatoBidAdapter.js +1 -1
  97. package/dist/smartadserverBidAdapter.js +1 -1
  98. package/dist/smartxBidAdapter.js +1 -1
  99. package/dist/smilewantedBidAdapter.js +1 -1
  100. package/dist/sonobiBidAdapter.js +1 -1
  101. package/dist/sovrnAnalyticsAdapter.js +1 -1
  102. package/dist/sovrnBidAdapter.js +1 -1
  103. package/dist/sspBCBidAdapter.js +1 -1
  104. package/dist/sublimeBidAdapter.js +1 -1
  105. package/dist/synacormediaBidAdapter.js +1 -1
  106. package/dist/taboolaBidAdapter.js +1 -1
  107. package/dist/targetVideoBidAdapter.js +1 -1
  108. package/dist/teadsBidAdapter.js +1 -1
  109. package/dist/trionBidAdapter.js +1 -1
  110. package/dist/tripleliftBidAdapter.js +1 -1
  111. package/dist/ttdBidAdapter.js +1 -1
  112. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  113. package/dist/uid2IdSystem.js +1 -1
  114. package/dist/underdogmediaBidAdapter.js +1 -1
  115. package/dist/undertoneBidAdapter.js +1 -1
  116. package/dist/vidazooBidAdapter.js +1 -1
  117. package/dist/videobyteBidAdapter.js +1 -1
  118. package/dist/visxBidAdapter.js +1 -1
  119. package/dist/vuukleBidAdapter.js +1 -1
  120. package/dist/widespaceBidAdapter.js +1 -1
  121. package/dist/winrBidAdapter.js +1 -1
  122. package/dist/yahoosspBidAdapter.js +1 -1
  123. package/dist/yieldlabBidAdapter.js +1 -1
  124. package/dist/yieldmoBidAdapter.js +1 -1
  125. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  126. package/integrationExamples/gpt/adloox.html +5 -0
  127. package/modules/adagioBidAdapter.js +0 -4
  128. package/modules/adagioBidAdapter.md +4 -22
  129. package/modules/adlooxAnalyticsAdapter.md +5 -3
  130. package/modules/adlooxRtdProvider.js +82 -278
  131. package/modules/adlooxRtdProvider.md +6 -6
  132. package/modules/aidemBidAdapter.js +4 -0
  133. package/modules/aidemBidAdapter.md +1 -0
  134. package/modules/alkimiBidAdapter.js +23 -6
  135. package/modules/aolBidAdapter.js +12 -0
  136. package/modules/appnexusBidAdapter.js +2 -2
  137. package/modules/appushBidAdapter.js +188 -0
  138. package/modules/appushBidAdapter.md +79 -0
  139. package/modules/asoBidAdapter.js +8 -5
  140. package/modules/confiantRtdProvider.js +1 -1
  141. package/modules/connectIdSystem.js +15 -1
  142. package/modules/feedadBidAdapter.js +7 -5
  143. package/modules/holidBidAdapter.js +170 -0
  144. package/modules/holidBidAdapter.md +36 -0
  145. package/modules/jwplayerVideoProvider.js +10 -3
  146. package/modules/kueezRtbBidAdapter.js +21 -8
  147. package/modules/medianetRtdProvider.js +4 -4
  148. package/modules/nexx360BidAdapter.js +5 -7
  149. package/modules/orbitsoftBidAdapter.js +150 -0
  150. package/modules/permutiveRtdProvider.js +1 -1
  151. package/modules/riseBidAdapter.js +2 -1
  152. package/modules/riseBidAdapter.md +2 -0
  153. package/modules/seedtagBidAdapter.js +12 -0
  154. package/modules/smartxBidAdapter.js +6 -0
  155. package/modules/taboolaBidAdapter.js +61 -14
  156. package/modules/yahoosspBidAdapter.js +5 -0
  157. package/modules/yieldlabBidAdapter.js +150 -134
  158. package/modules/yieldmoBidAdapter.js +1 -12
  159. package/package.json +1 -1
  160. package/test/spec/modules/adagioBidAdapter_spec.js +1 -28
  161. package/test/spec/modules/adlooxRtdProvider_spec.js +28 -120
  162. package/test/spec/modules/aidemBidAdapter_spec.js +10 -2
  163. package/test/spec/modules/alkimiBidAdapter_spec.js +15 -3
  164. package/test/spec/modules/aolBidAdapter_spec.js +22 -0
  165. package/test/spec/modules/appnexusBidAdapter_spec.js +7 -3
  166. package/test/spec/modules/appushBidAdapter_spec.js +372 -0
  167. package/test/spec/modules/connectIdSystem_spec.js +17 -5
  168. package/test/spec/modules/feedadBidAdapter_spec.js +23 -1
  169. package/test/spec/modules/holidBidAdapter_spec.js +165 -0
  170. package/test/spec/modules/kueezRtbBidAdapter_spec.js +147 -24
  171. package/test/spec/modules/medianetRtdProvider_spec.js +3 -3
  172. package/test/spec/modules/orbitsoftBidAdapter_spec.js +255 -0
  173. package/test/spec/modules/riseBidAdapter_spec.js +7 -0
  174. package/test/spec/modules/seedtagBidAdapter_spec.js +56 -10
  175. package/test/spec/modules/smartxBidAdapter_spec.js +10 -0
  176. package/test/spec/modules/taboolaBidAdapter_spec.js +142 -5
  177. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +45 -10
  178. package/test/spec/modules/yahoosspBidAdapter_spec.js +16 -1
  179. package/test/spec/modules/yieldlabBidAdapter_spec.js +311 -301
  180. package/test/spec/modules/yieldmoBidAdapter_spec.js +70 -0
@@ -374,6 +374,16 @@ describe('The smartx adapter', function () {
374
374
  }
375
375
  })
376
376
  });
377
+
378
+ it('should pass sitekey param', function () {
379
+ var request;
380
+
381
+ bid.params.sitekey = 'foo'
382
+
383
+ request = spec.buildRequests([bid], bidRequestObj)[0];
384
+
385
+ expect(request.data.site.content.ext.sitekey).to.equal('foo');
386
+ });
377
387
  });
378
388
 
379
389
  describe('interpretResponse', function () {
@@ -2,6 +2,7 @@ import {expect} from 'chai';
2
2
  import {spec, internal, END_POINT_URL, userData} from 'modules/taboolaBidAdapter.js';
3
3
  import {config} from '../../../src/config'
4
4
  import * as utils from '../../../src/utils'
5
+ import {server} from '../../mocks/xhr'
5
6
 
6
7
  describe('Taboola Adapter', function () {
7
8
  let hasLocalStorage, cookiesAreEnabled, getDataFromLocalStorage, localStorageIsEnabled, getCookie, commonBidRequest;
@@ -91,6 +92,31 @@ describe('Taboola Adapter', function () {
91
92
  })
92
93
  })
93
94
 
95
+ describe('onBidWon', function () {
96
+ it('onBidWon exist as a function', () => {
97
+ expect(spec.onBidWon).to.exist.and.to.be.a('function');
98
+ });
99
+
100
+ it('should resolve price macro in nurl', function () {
101
+ const nurl = 'http://win.example.com/${AUCTION_PRICE}';
102
+ const bid = {
103
+ requestId: 1,
104
+ cpm: 2,
105
+ originalCpm: 3.4,
106
+ creativeId: 1,
107
+ ttl: 60,
108
+ netRevenue: true,
109
+ mediaType: 'banner',
110
+ ad: '...',
111
+ width: 300,
112
+ height: 250,
113
+ nurl: nurl
114
+ }
115
+ spec.onBidWon(bid);
116
+ expect(server.requests[0].url).to.equals('http://win.example.com/3.4')
117
+ });
118
+ });
119
+
94
120
  describe('buildRequests', function () {
95
121
  const defaultBidRequest = {
96
122
  ...createBidRequest(),
@@ -122,7 +148,8 @@ describe('Taboola Adapter', function () {
122
148
  },
123
149
  'tagid': commonBidRequest.params.tagId,
124
150
  'bidfloor': null,
125
- 'bidfloorcur': 'USD'
151
+ 'bidfloorcur': 'USD',
152
+ 'ext': {}
126
153
  }],
127
154
  'site': {
128
155
  'id': commonBidRequest.params.publisherId,
@@ -137,11 +164,13 @@ describe('Taboola Adapter', function () {
137
164
  'source': {'fd': 1},
138
165
  'bcat': [],
139
166
  'badv': [],
167
+ 'wlang': [],
140
168
  'user': {
141
169
  'buyeruid': 0,
142
170
  'ext': {},
143
171
  },
144
- 'regs': {'coppa': 0, 'ext': {}}
172
+ 'regs': {'coppa': 0, 'ext': {}},
173
+ 'ext': {}
145
174
  };
146
175
 
147
176
  const res = spec.buildRequests([defaultBidRequest], commonBidderRequest);
@@ -184,7 +213,7 @@ describe('Taboola Adapter', function () {
184
213
  expect(resData.imp[0].bidfloorcur).to.deep.equal('USD');
185
214
  });
186
215
 
187
- it('should pass bid floor even if they is a bid floor param', function () {
216
+ it('should pass bid floor even if it is a bid floor param', function () {
188
217
  const optionalParams = {
189
218
  bidfloor: 0.25,
190
219
  bidfloorcur: 'EUR'
@@ -206,6 +235,38 @@ describe('Taboola Adapter', function () {
206
235
  expect(resData.imp[0].bidfloorcur).to.deep.equal('USD');
207
236
  });
208
237
 
238
+ it('should pass impression position', function () {
239
+ const optionalParams = {
240
+ position: 2
241
+ };
242
+
243
+ const bidRequest = {
244
+ ...defaultBidRequest,
245
+ params: {...commonBidRequest.params, ...optionalParams}
246
+ };
247
+
248
+ const res = spec.buildRequests([bidRequest], commonBidderRequest);
249
+ const resData = JSON.parse(res.data);
250
+ expect(resData.imp[0].banner.pos).to.deep.equal(2);
251
+ });
252
+
253
+ it('should pass gpid if configured', function () {
254
+ const ortb2Imp = {
255
+ ext: {
256
+ gpid: '/homepage/#1'
257
+ }
258
+ }
259
+ const bidRequest = {
260
+ ...defaultBidRequest,
261
+ ortb2Imp: ortb2Imp,
262
+ params: {...commonBidRequest.params}
263
+ };
264
+
265
+ const res = spec.buildRequests([bidRequest], commonBidderRequest);
266
+ const resData = JSON.parse(res.data);
267
+ expect(resData.imp[0].ext.gpid).to.deep.equal('/homepage/#1');
268
+ });
269
+
209
270
  it('should pass bidder timeout', function () {
210
271
  const bidderRequest = {
211
272
  ...commonBidderRequest,
@@ -216,6 +277,40 @@ describe('Taboola Adapter', function () {
216
277
  expect(resData.tmax).to.equal(500);
217
278
  });
218
279
 
280
+ describe('first party data', function () {
281
+ it('should parse first party data', function () {
282
+ const bidderRequest = {
283
+ ...commonBidderRequest,
284
+ ortb2: {
285
+ bcat: ['EX1', 'EX2', 'EX3'],
286
+ badv: ['site.com'],
287
+ wlang: ['de'],
288
+ }
289
+ }
290
+ const res = spec.buildRequests([defaultBidRequest], bidderRequest);
291
+ const resData = JSON.parse(res.data);
292
+ expect(resData.bcat).to.deep.equal(bidderRequest.ortb2.bcat)
293
+ expect(resData.badv).to.deep.equal(bidderRequest.ortb2.badv)
294
+ expect(resData.wlang).to.deep.equal(bidderRequest.ortb2.wlang)
295
+ });
296
+
297
+ it('should pass pageType if exists in ortb2', function () {
298
+ const bidderRequest = {
299
+ ...commonBidderRequest,
300
+ ortb2: {
301
+ ext: {
302
+ data: {
303
+ pageType: 'news'
304
+ }
305
+ }
306
+ }
307
+ }
308
+ const res = spec.buildRequests([defaultBidRequest], bidderRequest);
309
+ const resData = JSON.parse(res.data);
310
+ expect(resData.ext.pageType).to.deep.equal(bidderRequest.ortb2.ext.data.pageType);
311
+ });
312
+ });
313
+
219
314
  describe('handle privacy segments when building request', function () {
220
315
  it('should pass GDPR consent', function () {
221
316
  const bidderRequest = {
@@ -234,6 +329,20 @@ describe('Taboola Adapter', function () {
234
329
  expect(resData.regs.ext.gdpr).to.equal(1)
235
330
  });
236
331
 
332
+ it('should pass GPP consent if exist in ortb2', function () {
333
+ const ortb2 = {
334
+ regs: {
335
+ gpp: 'testGpp',
336
+ gpp_sid: [1, 2, 3]
337
+ }
338
+ }
339
+
340
+ const res = spec.buildRequests([defaultBidRequest], {...commonBidderRequest, ortb2})
341
+ const resData = JSON.parse(res.data)
342
+ expect(resData.regs.ext.gpp).to.equal('testGpp')
343
+ expect(resData.regs.ext.gpp_sid).to.deep.equal([1, 2, 3])
344
+ });
345
+
237
346
  it('should pass us privacy consent', function () {
238
347
  const bidderRequest = {
239
348
  refererInfo: {
@@ -552,8 +661,36 @@ describe('Taboola Adapter', function () {
552
661
  });
553
662
  })
554
663
 
555
- describe('userData', function () {
556
- // todo: add UT for getUserSyncs
664
+ describe('getUserSyncs', function () {
665
+ const usersyncUrl = 'https://trc.taboola.com/sg/prebidJS/1/cm';
666
+
667
+ it('should not return user sync if pixelEnabled is false', function () {
668
+ const res = spec.getUserSyncs({pixelEnabled: false});
669
+ expect(res).to.be.an('array').that.is.empty;
670
+ });
671
+
672
+ it('should return user sync if pixelEnabled is true', function () {
673
+ const res = spec.getUserSyncs({pixelEnabled: true});
674
+ expect(res).to.deep.equal([{type: 'image', url: usersyncUrl}]);
675
+ });
676
+
677
+ it('should pass consent tokens values', function() {
678
+ expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {gdprApplies: true, consentString: 'GDPR_CONSENT'}, 'USP_CONSENT')).to.deep.equal([{
679
+ type: 'image', url: `${usersyncUrl}?gdpr=1&gdpr_consent=GDPR_CONSENT&us_privacy=USP_CONSENT`
680
+ }]);
681
+ expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {gdprApplies: false, consentString: undefined}, undefined)).to.deep.equal([{
682
+ type: 'image', url: `${usersyncUrl}?gdpr=0&gdpr_consent=`
683
+ }]);
684
+ expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {gdprApplies: false, consentString: undefined}, undefined)).to.deep.equal([{
685
+ type: 'image', url: `${usersyncUrl}?gdpr=0&gdpr_consent=`
686
+ }]);
687
+ expect(spec.getUserSyncs({ pixelEnabled: true }, {}, undefined, 'USP_CONSENT')).to.deep.equal([{
688
+ type: 'image', url: `${usersyncUrl}?us_privacy=USP_CONSENT`
689
+ }]);
690
+ expect(spec.getUserSyncs({ pixelEnabled: true }, {}, undefined, 'USP_CONSENT', 'GPP_STRING')).to.deep.equal([{
691
+ type: 'image', url: `${usersyncUrl}?us_privacy=USP_CONSENT&gpp=GPP_STRING`
692
+ }]);
693
+ });
557
694
  })
558
695
 
559
696
  describe('internal functions', function () {
@@ -66,7 +66,28 @@ function getUtilsMock() {
66
66
 
67
67
  const sharedUtils = { videoEvents };
68
68
 
69
+ function addDiv() {
70
+ const div = document.createElement('div');
71
+ div.setAttribute('id', 'test');
72
+ document.body.appendChild(div);
73
+ }
74
+
75
+ function removeDiv() {
76
+ const div = document.getElementById('test');
77
+ if (div) {
78
+ div.remove();
79
+ }
80
+ }
81
+
69
82
  describe('JWPlayerProvider', function () {
83
+ beforeEach(() => {
84
+ addDiv();
85
+ });
86
+
87
+ afterEach(() => {
88
+ removeDiv();
89
+ });
90
+
70
91
  describe('init', function () {
71
92
  let config;
72
93
  let adState;
@@ -75,7 +96,7 @@ describe('JWPlayerProvider', function () {
75
96
  let utilsMock;
76
97
 
77
98
  beforeEach(() => {
78
- config = {};
99
+ config = { divId: 'test' };
79
100
  adState = adStateFactory();
80
101
  timeState = timeStateFactory();
81
102
  callbackStorage = callbackStorageFactory();
@@ -104,7 +125,21 @@ describe('JWPlayerProvider', function () {
104
125
  expect(payload.errorCode).to.be.equal(-2);
105
126
  });
106
127
 
107
- it('should instantiate the player when uninstantied', function () {
128
+ it('should trigger failure when div is missing', function () {
129
+ removeDiv();
130
+ let jwplayerMock = () => {};
131
+ const provider = JWPlayerProvider(config, jwplayerMock, adState, timeState, callbackStorage, utilsMock, sharedUtils);
132
+ const setupFailed = sinon.spy();
133
+ provider.onEvent(SETUP_FAILED, setupFailed, {});
134
+ provider.init();
135
+ expect(setupFailed.calledOnce).to.be.true;
136
+ const payload = setupFailed.args[0][1];
137
+ expect(payload.errorCode).to.be.equal(-3);
138
+ addDiv();
139
+ addDiv();
140
+ });
141
+
142
+ it('should instantiate the player when uninstantiated', function () {
108
143
  const player = getPlayerMock();
109
144
  config.playerConfig = {};
110
145
  const setupSpy = player.setup = sinon.spy();
@@ -113,7 +148,7 @@ describe('JWPlayerProvider', function () {
113
148
  expect(setupSpy.calledOnce).to.be.true;
114
149
  });
115
150
 
116
- it('should trigger setup complete when player is already instantied', function () {
151
+ it('should trigger setup complete when player is already instantiated', function () {
117
152
  const player = getPlayerMock();
118
153
  player.getState = () => 'idle';
119
154
  const provider = JWPlayerProvider(config, makePlayerFactoryMock(player), adState, timeState, callbackStorage, utilsMock, sharedUtils);
@@ -151,7 +186,7 @@ describe('JWPlayerProvider', function () {
151
186
  const test_playback_method = PLAYBACK_METHODS.CLICK_TO_PLAY;
152
187
  const test_skip = 0;
153
188
 
154
- const config = {};
189
+ const config = { divId: 'test' };
155
190
  const player = getPlayerMock();
156
191
  const utils = getUtilsMock();
157
192
 
@@ -230,9 +265,9 @@ describe('JWPlayerProvider', function () {
230
265
  duration: test_duration,
231
266
  playbackMode: test_playback_mode
232
267
  })
233
- }
268
+ };
234
269
 
235
- const provider = JWPlayerProvider({}, makePlayerFactoryMock(player), adStateFactory(), timeState, {}, utils, sharedUtils);
270
+ const provider = JWPlayerProvider({ divId: 'test' }, makePlayerFactoryMock(player), adStateFactory(), timeState, {}, utils, sharedUtils);
236
271
  provider.init();
237
272
 
238
273
  let content = provider.getOrtbContent();
@@ -260,7 +295,7 @@ describe('JWPlayerProvider', function () {
260
295
  it('should call playAd', function () {
261
296
  const player = getPlayerMock();
262
297
  const playAdSpy = player.playAd = sinon.spy();
263
- const provider = JWPlayerProvider({}, makePlayerFactoryMock(player), {}, {}, {}, {}, sharedUtils);
298
+ const provider = JWPlayerProvider({ divId: 'test' }, makePlayerFactoryMock(player), {}, {}, {}, {}, sharedUtils);
264
299
  provider.init();
265
300
  provider.setAdTagUrl('tag');
266
301
  expect(playAdSpy.called).to.be.true;
@@ -273,7 +308,7 @@ describe('JWPlayerProvider', function () {
273
308
  it('should register event listener on player', function () {
274
309
  const player = getPlayerMock();
275
310
  const onSpy = player.on = sinon.spy();
276
- const provider = JWPlayerProvider({}, makePlayerFactoryMock(player), adStateFactory(), timeStateFactory(), callbackStorageFactory(), getUtilsMock(), sharedUtils);
311
+ const provider = JWPlayerProvider({ divId: 'test' }, makePlayerFactoryMock(player), adStateFactory(), timeStateFactory(), callbackStorageFactory(), getUtilsMock(), sharedUtils);
277
312
  provider.init();
278
313
  const callback = () => {};
279
314
  provider.onEvent(PLAY, callback, {});
@@ -285,7 +320,7 @@ describe('JWPlayerProvider', function () {
285
320
  it('should remove event listener on player', function () {
286
321
  const player = getPlayerMock();
287
322
  const offSpy = player.off = sinon.spy();
288
- const provider = JWPlayerProvider({}, makePlayerFactoryMock(player), adStateFactory(), timeStateFactory(), callbackStorageFactory(), utils, sharedUtils);
323
+ const provider = JWPlayerProvider({ divId: 'test' }, makePlayerFactoryMock(player), adStateFactory(), timeStateFactory(), callbackStorageFactory(), utils, sharedUtils);
289
324
  provider.init();
290
325
  const callback = () => {};
291
326
  provider.onEvent(AD_IMPRESSION, callback, {});
@@ -301,7 +336,7 @@ describe('JWPlayerProvider', function () {
301
336
  const player = getPlayerMock();
302
337
  const removeSpy = player.remove = sinon.spy();
303
338
  player.remove = removeSpy;
304
- const provider = JWPlayerProvider({}, makePlayerFactoryMock(player), adStateFactory(), timeStateFactory(), callbackStorageFactory(), getUtilsMock(), sharedUtils);
339
+ const provider = JWPlayerProvider({ divId: 'test' }, makePlayerFactoryMock(player), adStateFactory(), timeStateFactory(), callbackStorageFactory(), getUtilsMock(), sharedUtils);
305
340
  provider.init();
306
341
  provider.destroy();
307
342
  provider.destroy();
@@ -3,6 +3,7 @@ import { config } from 'src/config.js';
3
3
  import { BANNER, VIDEO } from 'src/mediaTypes.js';
4
4
  import { spec } from 'modules/yahoosspBidAdapter.js';
5
5
  import {createEidsArray} from '../../../modules/userId/eids';
6
+ import {deepClone} from '../../../src/utils';
6
7
 
7
8
  const DEFAULT_BID_ID = '84ab500420319d';
8
9
  const DEFAULT_BID_DCN = '2093845709823475';
@@ -713,7 +714,7 @@ describe('YahooSSP Bid Adapter:', () => {
713
714
  });
714
715
  });
715
716
 
716
- describe('GDPR & Consent:', () => {
717
+ describe('GDPR & Consent & GPP:', () => {
717
718
  it('should return request objects that do not send cookies if purpose 1 consent is not provided', () => {
718
719
  const { validBidRequests, bidderRequest } = generateBuildRequestMock({});
719
720
  bidderRequest.gdprConsent = {
@@ -731,6 +732,20 @@ describe('YahooSSP Bid Adapter:', () => {
731
732
  const options = spec.buildRequests(validBidRequests, bidderRequest)[0].options;
732
733
  expect(options.withCredentials).to.be.false;
733
734
  });
735
+
736
+ it('adds the ortb2 gpp consent info to the request', function () {
737
+ const { validBidRequests, bidderRequest } = generateBuildRequestMock({});
738
+ const ortb2 = {
739
+ regs: {
740
+ gpp: 'somegppstring',
741
+ gpp_sid: [6, 7]
742
+ }
743
+ };
744
+ let clonedBidderRequest = {...bidderRequest, ortb2};
745
+ const data = spec.buildRequests(validBidRequests, clonedBidderRequest)[0].data;
746
+ expect(data.regs.ext.gpp).to.equal('somegppstring');
747
+ expect(data.regs.ext.gpp_sid).to.eql([6, 7]);
748
+ });
734
749
  });
735
750
 
736
751
  describe('Endpoint & Impression Request Mode:', () => {