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.
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/aidemBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/aolBidAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/appushBidAdapter.js +1 -0
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/holidBidAdapter.js +1 -0
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerVideoProvider.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetRtdProvider.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +126 -123
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/orbitsoftBidAdapter.js +1 -0
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldlabBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/adloox.html +5 -0
- package/modules/adagioBidAdapter.js +0 -4
- package/modules/adagioBidAdapter.md +4 -22
- package/modules/adlooxAnalyticsAdapter.md +5 -3
- package/modules/adlooxRtdProvider.js +82 -278
- package/modules/adlooxRtdProvider.md +6 -6
- package/modules/aidemBidAdapter.js +4 -0
- package/modules/aidemBidAdapter.md +1 -0
- package/modules/alkimiBidAdapter.js +23 -6
- package/modules/aolBidAdapter.js +12 -0
- package/modules/appnexusBidAdapter.js +2 -2
- package/modules/appushBidAdapter.js +188 -0
- package/modules/appushBidAdapter.md +79 -0
- package/modules/asoBidAdapter.js +8 -5
- package/modules/confiantRtdProvider.js +1 -1
- package/modules/connectIdSystem.js +15 -1
- package/modules/feedadBidAdapter.js +7 -5
- package/modules/holidBidAdapter.js +170 -0
- package/modules/holidBidAdapter.md +36 -0
- package/modules/jwplayerVideoProvider.js +10 -3
- package/modules/kueezRtbBidAdapter.js +21 -8
- package/modules/medianetRtdProvider.js +4 -4
- package/modules/nexx360BidAdapter.js +5 -7
- package/modules/orbitsoftBidAdapter.js +150 -0
- package/modules/permutiveRtdProvider.js +1 -1
- package/modules/riseBidAdapter.js +2 -1
- package/modules/riseBidAdapter.md +2 -0
- package/modules/seedtagBidAdapter.js +12 -0
- package/modules/smartxBidAdapter.js +6 -0
- package/modules/taboolaBidAdapter.js +61 -14
- package/modules/yahoosspBidAdapter.js +5 -0
- package/modules/yieldlabBidAdapter.js +150 -134
- package/modules/yieldmoBidAdapter.js +1 -12
- package/package.json +1 -1
- package/test/spec/modules/adagioBidAdapter_spec.js +1 -28
- package/test/spec/modules/adlooxRtdProvider_spec.js +28 -120
- package/test/spec/modules/aidemBidAdapter_spec.js +10 -2
- package/test/spec/modules/alkimiBidAdapter_spec.js +15 -3
- package/test/spec/modules/aolBidAdapter_spec.js +22 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +7 -3
- package/test/spec/modules/appushBidAdapter_spec.js +372 -0
- package/test/spec/modules/connectIdSystem_spec.js +17 -5
- package/test/spec/modules/feedadBidAdapter_spec.js +23 -1
- package/test/spec/modules/holidBidAdapter_spec.js +165 -0
- package/test/spec/modules/kueezRtbBidAdapter_spec.js +147 -24
- package/test/spec/modules/medianetRtdProvider_spec.js +3 -3
- package/test/spec/modules/orbitsoftBidAdapter_spec.js +255 -0
- package/test/spec/modules/riseBidAdapter_spec.js +7 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +56 -10
- package/test/spec/modules/smartxBidAdapter_spec.js +10 -0
- package/test/spec/modules/taboolaBidAdapter_spec.js +142 -5
- package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +45 -10
- package/test/spec/modules/yahoosspBidAdapter_spec.js +16 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +311 -301
- 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
|
|
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('
|
|
556
|
-
|
|
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
|
|
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
|
|
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:', () => {
|