prebid.js 6.22.0 → 6.23.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 -0
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adfBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asealBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/audiencerunBidAdapter.js +1 -1
- package/dist/automatadBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bizzclickBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/concertBidAdapter.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/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/id5IdSystem.js +1 -1
- package/dist/impactifyBidAdapter.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/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerRtdProvider.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/livewrappedBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +117 -116
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneVideoBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +3 -3
- package/dist/prebidServerBidAdapter.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/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/sortableBidAdapter.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/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/trustxBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.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/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/userId_example.html +12 -0
- package/modules/.submodules.json +1 -0
- package/modules/33acrossIdSystem.js +115 -0
- package/modules/33acrossIdSystem.md +53 -0
- package/modules/adagioBidAdapter.js +45 -5
- package/modules/adfBidAdapter.js +5 -0
- package/modules/adyoulikeBidAdapter.js +1 -9
- package/modules/asealBidAdapter.js +62 -14
- package/modules/automatadBidAdapter.js +24 -11
- package/modules/automatadBidAdapter.md +2 -2
- package/modules/big-richmediaBidAdapter.js +9 -1
- package/modules/bizzclickBidAdapter.js +5 -14
- package/modules/criteoBidAdapter.js +20 -20
- package/modules/improvedigitalBidAdapter.js +10 -6
- package/modules/insticatorBidAdapter.js +14 -4
- package/modules/jixieBidAdapter.js +29 -0
- package/modules/jixieBidAdapter.md +1 -0
- package/modules/jwplayerRtdProvider.js +27 -9
- package/modules/jwplayerRtdProvider.md +5 -3
- package/modules/livewrappedBidAdapter.js +1 -1
- package/modules/minutemediaBidAdapter.js +206 -135
- package/modules/minutemediaBidAdapter.md +42 -17
- package/modules/prebidServerBidAdapter/index.js +4 -1
- package/modules/sovrnBidAdapter.js +16 -3
- package/modules/tripleliftBidAdapter.js +13 -9
- package/modules/userId/eids.js +9 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/index.js +5 -2
- package/modules/userId/userId.md +23 -2
- package/package.json +1 -1
- package/test/spec/modules/33acrossIdSystem_spec.js +413 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +11 -2
- package/test/spec/modules/adfBidAdapter_spec.js +27 -0
- package/test/spec/modules/asealBidAdapter_spec.js +134 -65
- package/test/spec/modules/automatadBidAdapter_spec.js +28 -11
- package/test/spec/modules/criteoBidAdapter_spec.js +33 -33
- package/test/spec/modules/eids_spec.js +17 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +27 -5
- package/test/spec/modules/insticatorBidAdapter_spec.js +24 -15
- package/test/spec/modules/jixieBidAdapter_spec.js +96 -0
- package/test/spec/modules/jwplayerRtdProvider_spec.js +50 -14
- package/test/spec/modules/livewrappedBidAdapter_spec.js +3 -1
- package/test/spec/modules/minutemediaBidAdapter_spec.js +196 -122
- package/test/spec/modules/prebidServerBidAdapter_spec.js +4 -0
- package/test/spec/modules/sovrnBidAdapter_spec.js +12 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +12 -2
- package/test/spec/modules/userId_spec.js +8 -0
- package/modules/pubnxBidAdapter.md +0 -31
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { spec } from 'modules/improvedigitalBidAdapter.js';
|
|
3
3
|
import { config } from 'src/config.js';
|
|
4
|
-
import
|
|
4
|
+
import { deepClone } from 'src/utils.js';
|
|
5
5
|
import {BANNER, VIDEO} from '../../../src/mediaTypes';
|
|
6
6
|
|
|
7
7
|
describe('Improve Digital Adapter Tests', function () {
|
|
@@ -34,7 +34,7 @@ describe('Improve Digital Adapter Tests', function () {
|
|
|
34
34
|
skipafter: 30
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const instreamBidRequest =
|
|
37
|
+
const instreamBidRequest = deepClone(simpleBidRequest);
|
|
38
38
|
instreamBidRequest.mediaTypes = {
|
|
39
39
|
video: {
|
|
40
40
|
context: 'instream',
|
|
@@ -42,7 +42,7 @@ describe('Improve Digital Adapter Tests', function () {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const outstreamBidRequest =
|
|
45
|
+
const outstreamBidRequest = deepClone(simpleBidRequest);
|
|
46
46
|
outstreamBidRequest.mediaTypes = {
|
|
47
47
|
video: {
|
|
48
48
|
context: 'outstream',
|
|
@@ -50,7 +50,7 @@ describe('Improve Digital Adapter Tests', function () {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
const multiFormatBidRequest =
|
|
53
|
+
const multiFormatBidRequest = deepClone(simpleBidRequest);
|
|
54
54
|
multiFormatBidRequest.mediaTypes = {
|
|
55
55
|
banner: {
|
|
56
56
|
sizes: [[300, 250], [160, 600]]
|
|
@@ -294,6 +294,14 @@ describe('Improve Digital Adapter Tests', function () {
|
|
|
294
294
|
expect(payload.user.ext.consented_providers_settings.consented_providers).to.exist.and.to.deep.equal([1, 35, 41, 101]);
|
|
295
295
|
});
|
|
296
296
|
|
|
297
|
+
it('should not add consented providers when empty', function () {
|
|
298
|
+
const bidderRequestGdprEmptyAddtl = deepClone(bidderRequestGdpr);
|
|
299
|
+
bidderRequestGdprEmptyAddtl.gdprConsent.addtlConsent = '1~';
|
|
300
|
+
const bidRequest = Object.assign({}, simpleBidRequest);
|
|
301
|
+
const payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequestGdprEmptyAddtl)[0].data);
|
|
302
|
+
expect(payload.user.ext.consented_providers_settings).to.not.exist;
|
|
303
|
+
});
|
|
304
|
+
|
|
297
305
|
it('should add CCPA consent string', function () {
|
|
298
306
|
const bidRequest = Object.assign({}, simpleBidRequest);
|
|
299
307
|
const request = spec.buildRequests([bidRequest], {...bidderRequest, ...{ uspConsent: '1YYY' }});
|
|
@@ -308,6 +316,20 @@ describe('Improve Digital Adapter Tests', function () {
|
|
|
308
316
|
expect(payload.site.page).to.equal('https://blah.com/test.html');
|
|
309
317
|
});
|
|
310
318
|
|
|
319
|
+
it('should add timeout', function () {
|
|
320
|
+
const bidderRequestTimeout = deepClone(bidderRequest);
|
|
321
|
+
// Int
|
|
322
|
+
bidderRequestTimeout.timeout = 300;
|
|
323
|
+
const bidRequest = Object.assign({}, simpleBidRequest);
|
|
324
|
+
let request = spec.buildRequests([bidRequest], bidderRequestTimeout)[0];
|
|
325
|
+
expect(JSON.parse(request.data).tmax).to.equal(300);
|
|
326
|
+
|
|
327
|
+
// String
|
|
328
|
+
bidderRequestTimeout.timeout = '500';
|
|
329
|
+
request = spec.buildRequests([bidRequest], bidderRequestTimeout)[0];
|
|
330
|
+
expect(JSON.parse(request.data).tmax).to.equal(500);
|
|
331
|
+
});
|
|
332
|
+
|
|
311
333
|
it('should not add video params for banner', function () {
|
|
312
334
|
const bidRequest = JSON.parse(JSON.stringify(simpleBidRequest));
|
|
313
335
|
bidRequest.params.video = videoParams;
|
|
@@ -916,7 +938,7 @@ describe('Improve Digital Adapter Tests', function () {
|
|
|
916
938
|
}
|
|
917
939
|
];
|
|
918
940
|
|
|
919
|
-
const expectedBidOutstreamVideo =
|
|
941
|
+
const expectedBidOutstreamVideo = deepClone(expectedBidInstreamVideo);
|
|
920
942
|
expectedBidOutstreamVideo[0].adResponse = {
|
|
921
943
|
content: expectedBidOutstreamVideo[0].vastXml
|
|
922
944
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { spec, storage } from '../../../modules/insticatorBidAdapter.js';
|
|
3
3
|
import { newBidder } from 'src/adapters/bidderFactory.js'
|
|
4
|
-
import { userSync } from '../../../src/userSync.js';
|
|
5
4
|
|
|
6
5
|
const USER_ID_KEY = 'hb_insticator_uid';
|
|
7
6
|
const USER_ID_DUMMY_VALUE = '74f78609-a92d-4cf1-869f-1b244bbfb5d2';
|
|
@@ -18,15 +17,21 @@ describe('InsticatorBidAdapter', function () {
|
|
|
18
17
|
adUnitCode: 'adunit-code',
|
|
19
18
|
params: {
|
|
20
19
|
adUnitId: '1a2b3c4d5e6f1a2b3c4d',
|
|
20
|
+
user: {
|
|
21
|
+
yob: 1984,
|
|
22
|
+
gender: 'M'
|
|
23
|
+
},
|
|
21
24
|
},
|
|
22
25
|
sizes: [[300, 250], [300, 600]],
|
|
23
26
|
mediaTypes: {
|
|
24
27
|
banner: {
|
|
25
|
-
sizes: [[300, 250], [300, 600]]
|
|
28
|
+
sizes: [[300, 250], [300, 600]],
|
|
29
|
+
pos: 4,
|
|
26
30
|
}
|
|
27
31
|
},
|
|
28
32
|
bidId: '30b31c1838de1e',
|
|
29
33
|
ortb2Imp: {
|
|
34
|
+
instl: 1,
|
|
30
35
|
ext: {
|
|
31
36
|
gpid: '1111/homepage'
|
|
32
37
|
}
|
|
@@ -91,16 +96,16 @@ describe('InsticatorBidAdapter', function () {
|
|
|
91
96
|
});
|
|
92
97
|
|
|
93
98
|
it('should return false if there is no adUnitId param', () => {
|
|
94
|
-
expect(spec.isBidRequestValid({...bidRequest, ...{params: {}}})).to.be.false;
|
|
99
|
+
expect(spec.isBidRequestValid({ ...bidRequest, ...{ params: {} } })).to.be.false;
|
|
95
100
|
});
|
|
96
101
|
|
|
97
102
|
it('should return false if there is no mediaTypes', () => {
|
|
98
|
-
expect(spec.isBidRequestValid({...bidRequest, ...{mediaTypes: {}}})).to.be.false;
|
|
103
|
+
expect(spec.isBidRequestValid({ ...bidRequest, ...{ mediaTypes: {} } })).to.be.false;
|
|
99
104
|
});
|
|
100
105
|
|
|
101
106
|
it('should return false if there are no banner sizes and no sizes', () => {
|
|
102
107
|
bidRequest.mediaTypes.banner = {};
|
|
103
|
-
expect(spec.isBidRequestValid({...bidRequest, ...{sizes: {}}})).to.be.false;
|
|
108
|
+
expect(spec.isBidRequestValid({ ...bidRequest, ...{ sizes: {} } })).to.be.false;
|
|
104
109
|
});
|
|
105
110
|
|
|
106
111
|
it('should return true if there is sizes and no banner sizes', () => {
|
|
@@ -109,7 +114,7 @@ describe('InsticatorBidAdapter', function () {
|
|
|
109
114
|
|
|
110
115
|
it('should return true if there is banner sizes and no sizes', () => {
|
|
111
116
|
bidRequest.mediaTypes.banner.sizes = [[300, 250], [300, 600]];
|
|
112
|
-
expect(spec.isBidRequestValid({...bidRequest, ...{sizes: {}}})).to.be.true;
|
|
117
|
+
expect(spec.isBidRequestValid({ ...bidRequest, ...{ sizes: {} } })).to.be.true;
|
|
113
118
|
});
|
|
114
119
|
});
|
|
115
120
|
|
|
@@ -207,6 +212,10 @@ describe('InsticatorBidAdapter', function () {
|
|
|
207
212
|
expect(data.regs.ext.gdprConsentString).to.equal(bidderRequest.gdprConsent.consentString);
|
|
208
213
|
expect(data.user).to.be.an('object');
|
|
209
214
|
expect(data.user.id).to.equal(USER_ID_DUMMY_VALUE);
|
|
215
|
+
expect(data.user).to.have.property('yob');
|
|
216
|
+
expect(data.user.yob).to.equal(1984);
|
|
217
|
+
expect(data.user).to.have.property('gender');
|
|
218
|
+
expect(data.user.gender).to.equal('M');
|
|
210
219
|
expect(data.user.ext).to.have.property('eids');
|
|
211
220
|
expect(data.user.ext.eids).to.deep.equal([
|
|
212
221
|
{
|
|
@@ -223,10 +232,12 @@ describe('InsticatorBidAdapter', function () {
|
|
|
223
232
|
expect(data.imp).to.deep.equal([{
|
|
224
233
|
id: bidRequest.bidId,
|
|
225
234
|
tagid: bidRequest.adUnitCode,
|
|
235
|
+
instl: 1,
|
|
236
|
+
secure: 0,
|
|
226
237
|
banner: {
|
|
227
238
|
format: [
|
|
228
|
-
{w: 300, h: 250},
|
|
229
|
-
{w: 300, h: 600},
|
|
239
|
+
{ w: 300, h: 250 },
|
|
240
|
+
{ w: 300, h: 600 },
|
|
230
241
|
]
|
|
231
242
|
},
|
|
232
243
|
ext: {
|
|
@@ -256,7 +267,7 @@ describe('InsticatorBidAdapter', function () {
|
|
|
256
267
|
expect(data.user.id).to.equal(USER_ID_STUBBED);
|
|
257
268
|
});
|
|
258
269
|
it('should return empty regs object if no gdprConsent is passed', function () {
|
|
259
|
-
const requests = spec.buildRequests([bidRequest], {...bidderRequest, ...{gdprConsent: false}});
|
|
270
|
+
const requests = spec.buildRequests([bidRequest], { ...bidderRequest, ...{ gdprConsent: false } });
|
|
260
271
|
const data = JSON.parse(requests[0].data);
|
|
261
272
|
expect(data.regs).to.be.an('object').that.is.empty;
|
|
262
273
|
});
|
|
@@ -384,14 +395,12 @@ describe('InsticatorBidAdapter', function () {
|
|
|
384
395
|
width: 300,
|
|
385
396
|
height: 200,
|
|
386
397
|
mediaType: 'banner',
|
|
387
|
-
meta: {
|
|
388
|
-
advertiserDomains: [
|
|
389
|
-
'test1.com'
|
|
390
|
-
],
|
|
391
|
-
test: 1
|
|
392
|
-
},
|
|
393
398
|
ad: 'adm1',
|
|
394
399
|
adUnitCode: 'adunit-code-1',
|
|
400
|
+
meta: {
|
|
401
|
+
advertiserDomains: ['test1.com'],
|
|
402
|
+
test: 1
|
|
403
|
+
}
|
|
395
404
|
},
|
|
396
405
|
{
|
|
397
406
|
requestId: 'bid2',
|
|
@@ -240,6 +240,102 @@ describe('jixie Adapter', function () {
|
|
|
240
240
|
getLocalStorageStub.restore();
|
|
241
241
|
miscDimsStub.restore();
|
|
242
242
|
});// it
|
|
243
|
+
|
|
244
|
+
it('it should popular the pricegranularity when info is available', function () {
|
|
245
|
+
let content = {
|
|
246
|
+
'ranges': [{
|
|
247
|
+
'max': 12,
|
|
248
|
+
'increment': 0.5
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
'max': 5,
|
|
252
|
+
'increment': 0.1
|
|
253
|
+
}],
|
|
254
|
+
precision: 1
|
|
255
|
+
};
|
|
256
|
+
let getConfigStub = sinon.stub(config, 'getConfig');
|
|
257
|
+
getConfigStub.callsFake(function fakeFn(prop) {
|
|
258
|
+
if (prop == 'priceGranularity') {
|
|
259
|
+
return content;
|
|
260
|
+
}
|
|
261
|
+
return null;
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
const oneSpecialBidReq = Object.assign({}, bidRequests_[0]);
|
|
265
|
+
const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_);
|
|
266
|
+
const payload = JSON.parse(request.data);
|
|
267
|
+
getConfigStub.restore();
|
|
268
|
+
expect(payload.pricegranularity).to.deep.include(content);
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it('should populate eids when supported userIds are available', function () {
|
|
272
|
+
const oneSpecialBidReq = Object.assign({}, bidRequests_[0], {
|
|
273
|
+
userId: {
|
|
274
|
+
tdid: '11111111-2222-3333-4444-555555555555',
|
|
275
|
+
uid2: { id: 'AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==' },
|
|
276
|
+
pubProvidedId: [{
|
|
277
|
+
source: 'puburl1.com',
|
|
278
|
+
uids: [{
|
|
279
|
+
id: 'pubid1',
|
|
280
|
+
atype: 1,
|
|
281
|
+
ext: {
|
|
282
|
+
stype: 'ppuid'
|
|
283
|
+
}
|
|
284
|
+
}]
|
|
285
|
+
}, {
|
|
286
|
+
source: 'puburl2.com',
|
|
287
|
+
uids: [{
|
|
288
|
+
id: 'pubid2'
|
|
289
|
+
}]
|
|
290
|
+
}]
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_);
|
|
294
|
+
const payload = JSON.parse(request.data);
|
|
295
|
+
expect(payload.eids).to.deep.include({
|
|
296
|
+
'source': 'adserver.org',
|
|
297
|
+
'uids': [
|
|
298
|
+
{
|
|
299
|
+
'id': '11111111-2222-3333-4444-555555555555',
|
|
300
|
+
'atype': 1,
|
|
301
|
+
'ext': {
|
|
302
|
+
'rtiPartner': 'TDID'
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
});
|
|
307
|
+
expect(payload.eids).to.deep.include({
|
|
308
|
+
'source': 'uidapi.com',
|
|
309
|
+
'uids': [
|
|
310
|
+
{
|
|
311
|
+
'id': 'AbCdEfGhIjKlMnO9qdQBW7qtMw8f1WTUvtkHe6u+fqLfhbtsqrJ697Z6YoI3IB9klGUv1wvlFIbwH7ELDlqQBGtj8AC1v7fMJ/Q45E7W90dts7UQLTDMLNmtHBRDXVb0Fpas4Vh3yN1jGVQNhzXC/RpGIVtZE8dCxcjfa7VfcTNcvxxxxx==',
|
|
312
|
+
'atype': 3
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
expect(payload.eids).to.deep.include({
|
|
318
|
+
'source': 'puburl1.com',
|
|
319
|
+
'uids': [
|
|
320
|
+
{
|
|
321
|
+
'id': 'pubid1',
|
|
322
|
+
'atype': 1,
|
|
323
|
+
'ext': {
|
|
324
|
+
'stype': 'ppuid'
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
expect(payload.eids).to.deep.include({
|
|
331
|
+
'source': 'puburl2.com',
|
|
332
|
+
'uids': [
|
|
333
|
+
{
|
|
334
|
+
'id': 'pubid2'
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
});
|
|
338
|
+
});
|
|
243
339
|
});// describe
|
|
244
340
|
|
|
245
341
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fetchTargetingForMediaId, getVatFromCache, extractPublisherParams,
|
|
2
2
|
formatTargetingResponse, getVatFromPlayer, enrichAdUnits, addTargetingToBid,
|
|
3
|
-
fetchTargetingInformation, jwplayerSubmodule, getContentId, getContentData } from 'modules/jwplayerRtdProvider.js';
|
|
3
|
+
fetchTargetingInformation, jwplayerSubmodule, getContentId, getContentSegments, getContentData } from 'modules/jwplayerRtdProvider.js';
|
|
4
4
|
import { server } from 'test/mocks/xhr.js';
|
|
5
5
|
import {addOrtbSiteContent} from '../../../modules/jwplayerRtdProvider';
|
|
6
6
|
|
|
@@ -498,26 +498,62 @@ describe('jwplayerRtdProvider', function() {
|
|
|
498
498
|
});
|
|
499
499
|
});
|
|
500
500
|
|
|
501
|
-
describe('Get Content
|
|
501
|
+
describe('Get Content Segments', function () {
|
|
502
502
|
it('returns undefined when segments are empty', function () {
|
|
503
|
-
let
|
|
504
|
-
expect(
|
|
505
|
-
|
|
506
|
-
expect(
|
|
507
|
-
|
|
508
|
-
expect(
|
|
503
|
+
let contentSegments = getContentSegments(null);
|
|
504
|
+
expect(contentSegments).to.be.undefined;
|
|
505
|
+
contentSegments = getContentSegments(undefined);
|
|
506
|
+
expect(contentSegments).to.be.undefined;
|
|
507
|
+
contentSegments = getContentSegments([]);
|
|
508
|
+
expect(contentSegments).to.be.undefined;
|
|
509
509
|
});
|
|
510
510
|
|
|
511
511
|
it('returns proper format', function () {
|
|
512
512
|
const segment1 = 'segment1';
|
|
513
513
|
const segment2 = 'segment2';
|
|
514
514
|
const segment3 = 'segment3';
|
|
515
|
-
const
|
|
516
|
-
expect(
|
|
517
|
-
expect(
|
|
518
|
-
expect(
|
|
519
|
-
|
|
520
|
-
|
|
515
|
+
const contentSegments = getContentSegments([segment1, segment2, segment3]);
|
|
516
|
+
expect(contentSegments[0]).to.deep.equal({ id: segment1, value: segment1 });
|
|
517
|
+
expect(contentSegments[1]).to.deep.equal({ id: segment2, value: segment2 });
|
|
518
|
+
expect(contentSegments[2]).to.deep.equal({ id: segment3, value: segment3 });
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
describe('Get Content Data', function () {
|
|
523
|
+
it('should return proper format', function () {
|
|
524
|
+
const testMediaId = 'test_media_id';
|
|
525
|
+
const testSegments = [{ id: 1 }, { id: 2 }];
|
|
526
|
+
const contentData = getContentData(testMediaId, testSegments);
|
|
527
|
+
expect(contentData).to.have.property('name', 'jwplayer.com');
|
|
528
|
+
expect(contentData.ext).to.have.property('segtax', 502);
|
|
529
|
+
expect(contentData.ext).to.have.property('cids');
|
|
530
|
+
expect(contentData.ext.cids).to.have.length(1);
|
|
531
|
+
expect(contentData.ext.cids[0]).to.equal(testMediaId);
|
|
532
|
+
expect(contentData.segment).to.deep.equal(testSegments);
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
it('should only set segtax and segment when segments are provided', function () {
|
|
536
|
+
const testMediaId = 'test_media_id';
|
|
537
|
+
const contentData = getContentData(testMediaId);
|
|
538
|
+
expect(contentData).to.have.property('name', 'jwplayer.com');
|
|
539
|
+
expect(contentData.ext.segtax).to.be.undefined;
|
|
540
|
+
expect(contentData.ext).to.have.property('cids');
|
|
541
|
+
expect(contentData.ext.cids).to.have.length(1);
|
|
542
|
+
expect(contentData.ext.cids[0]).to.equal(testMediaId);
|
|
543
|
+
expect(contentData.segment).to.be.undefined;
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
it('should only set cids when a media id is provided', function () {
|
|
547
|
+
const testSegments = [{ id: 1 }, { id: 2 }];
|
|
548
|
+
const contentData = getContentData(null, testSegments);
|
|
549
|
+
expect(contentData).to.have.property('name', 'jwplayer.com');
|
|
550
|
+
expect(contentData.ext).to.have.property('segtax', 502);
|
|
551
|
+
expect(contentData.ext).to.not.have.property('cids');
|
|
552
|
+
expect(contentData.segment).to.deep.equal(testSegments);
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
it('should return undefined when no params are provided', function () {
|
|
556
|
+
expect(getContentData()).to.be.undefined;
|
|
521
557
|
});
|
|
522
558
|
});
|
|
523
559
|
|
|
@@ -890,9 +890,10 @@ describe('Livewrapped adapter tests', function () {
|
|
|
890
890
|
sandbox.stub(storage, 'cookiesAreEnabled').callsFake(() => true);
|
|
891
891
|
|
|
892
892
|
let origGetConfig = config.getConfig;
|
|
893
|
+
let orgOrtb2 = {user: {ext: {prop: 'value'}}};
|
|
893
894
|
sandbox.stub(config, 'getConfig').callsFake(function (key) {
|
|
894
895
|
if (key === 'ortb2') {
|
|
895
|
-
return
|
|
896
|
+
return orgOrtb2;
|
|
896
897
|
}
|
|
897
898
|
return origGetConfig.apply(config, arguments);
|
|
898
899
|
});
|
|
@@ -914,6 +915,7 @@ describe('Livewrapped adapter tests', function () {
|
|
|
914
915
|
var expected = {user: {ext: {prop: 'value', eids: testbidRequest.bids[0].userIdAsEids}}}
|
|
915
916
|
|
|
916
917
|
expect(data.rtbData).to.deep.equal(expected);
|
|
918
|
+
expect(orgOrtb2).to.deep.equal({user: {ext: {prop: 'value'}}});
|
|
917
919
|
});
|
|
918
920
|
|
|
919
921
|
it('should send schain object if available', function() {
|