prebid.js 7.18.0 → 7.19.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/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adfBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adqueryIdSystem.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.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/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/{andBeyondMediaBidAdapter.js → beyondmediaBidAdapter.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/cleanioRtdProvider.js +1 -1
- package/dist/colossussspBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -0
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/debugging-standalone.js +1 -1
- package/dist/debugging.js +1 -1
- package/dist/dependencies.json +6 -0
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dianomiBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/enrichmentFpdModule.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fpd.js +1 -0
- 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/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/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.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/nativoBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +123 -121
- package/dist/oguryBidAdapter.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 +1 -1
- 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/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/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/yandexBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/libraries/fpd/sua.js +98 -0
- package/modules/adfBidAdapter.js +1 -1
- package/modules/adkernelAdnBidAdapter.js +1 -0
- package/modules/adqueryIdSystem.js +8 -8
- package/modules/adxcgBidAdapter.js +1 -1
- package/modules/amxBidAdapter.js +1 -1
- package/modules/{andBeyondMediaBidAdapter.js → beyondmediaBidAdapter.js} +0 -0
- package/modules/{andBeyondMediaBidAdapter.md → beyondmediaBidAdapter.md} +1 -1
- package/modules/cleanioRtdProvider.js +3 -4
- package/modules/colossussspBidAdapter.js +2 -1
- package/modules/conversantAnalyticsAdapter.js +560 -0
- package/modules/conversantAnalyticsAdapter.md +47 -0
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/debugging/bidInterceptor.js +2 -2
- package/modules/debugging/debugging.js +10 -2
- package/modules/dgkeywordRtdProvider.js +21 -3
- package/modules/dianomiBidAdapter.js +1 -1
- package/modules/enrichmentFpdModule.js +33 -14
- package/modules/finativeBidAdapter.js +1 -1
- package/modules/gridBidAdapter.js +187 -117
- package/modules/improvedigitalBidAdapter.js +2 -2
- package/modules/ixBidAdapter.js +94 -23
- package/modules/liveIntentIdSystem.js +39 -5
- package/modules/mediakeysBidAdapter.js +6 -1
- package/modules/mediakeysBidAdapter.md +50 -40
- package/modules/nativoBidAdapter.js +1 -1
- package/modules/prebidServerBidAdapter/index.js +44 -13
- package/modules/readpeakBidAdapter.js +1 -1
- package/modules/rubiconBidAdapter.js +2 -3
- package/modules/seedingAllianceBidAdapter.js +1 -1
- package/modules/sharethroughBidAdapter.js +1 -1
- package/modules/taboolaBidAdapter.js +1 -1
- package/modules/talkadsBidAdapter.js +1 -0
- package/modules/truereachBidAdapter.js +1 -0
- package/modules/ttdBidAdapter.js +1 -1
- package/modules/vuukleBidAdapter.js +34 -3
- package/modules/yahoosspBidAdapter.js +3 -1
- package/modules/yandexBidAdapter.js +31 -8
- package/package.json +2 -2
- package/src/adapterManager.js +2 -4
- package/src/cpmBucketManager.js +22 -3
- package/src/native.js +1 -5
- package/src/prebid.js +3 -3
- package/test/spec/cpmBucketManager_spec.js +239 -177
- package/test/spec/fpd/sua_spec.js +244 -0
- package/test/spec/modules/adfBidAdapter_spec.js +2 -3
- package/test/spec/modules/adqueryIdSystem_spec.js +0 -2
- package/test/spec/modules/adxcgBidAdapter_spec.js +2 -3
- package/test/spec/modules/amxBidAdapter_spec.js +3 -2
- package/test/spec/modules/{andBeyondMediaBidAdapter_spec.js → beyondmediaBidAdapter_spec.js} +1 -1
- package/test/spec/modules/colossussspBidAdapter_spec.js +4 -2
- package/test/spec/modules/conversantAnalyticsAdapter_spec.js +963 -0
- package/test/spec/modules/debugging_mod_spec.js +9 -0
- package/test/spec/modules/dgkeywordRtdProvider_spec.js +83 -1
- package/test/spec/modules/dianomiBidAdapter_spec.js +2 -3
- package/test/spec/modules/enrichmentFpdModule_spec.js +50 -7
- package/test/spec/modules/fpdModule_spec.js +9 -0
- package/test/spec/modules/gridBidAdapter_spec.js +87 -31
- package/test/spec/modules/ixBidAdapter_spec.js +221 -2
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +62 -8
- package/test/spec/modules/liveIntentIdSystem_spec.js +62 -8
- package/test/spec/modules/mediakeysBidAdapter_spec.js +20 -3
- package/test/spec/modules/nativoBidAdapter_spec.js +13 -2
- package/test/spec/modules/prebidServerBidAdapter_spec.js +159 -4
- package/test/spec/modules/seedtagBidAdapter_spec.js +15 -18
- package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
- package/test/spec/modules/taboolaBidAdapter_spec.js +2 -2
- package/test/spec/modules/ttdBidAdapter_spec.js +3 -3
- package/test/spec/modules/vuukleBidAdapter_spec.js +87 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +3 -1
- package/test/spec/modules/yandexBidAdapter_spec.js +8 -5
- package/test/spec/native_spec.js +5 -0
- package/test/spec/unit/pbjs_api_spec.js +44 -0
|
@@ -273,6 +273,15 @@ describe('bid interceptor', () => {
|
|
|
273
273
|
});
|
|
274
274
|
});
|
|
275
275
|
|
|
276
|
+
describe('Debugging config', () => {
|
|
277
|
+
it('should behave gracefully when sessionStorage throws', () => {
|
|
278
|
+
const logError = sinon.stub();
|
|
279
|
+
const getStorage = () => { throw new Error() };
|
|
280
|
+
getConfig({enabled: false}, {getStorage, logger: {logError}, hook});
|
|
281
|
+
expect(logError.called).to.be.true;
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
|
|
276
285
|
describe('bidderBidInterceptor', () => {
|
|
277
286
|
let next, interceptBids, onCompletion, interceptResult, done, addBid;
|
|
278
287
|
|
|
@@ -302,7 +302,7 @@ describe('Digital Garage Keyword Module', function () {
|
|
|
302
302
|
JSON.stringify(DUMMY_RESPONSE)
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
|
-
},
|
|
305
|
+
}, 50);
|
|
306
306
|
});
|
|
307
307
|
it('should get profiles ok(200).', function (done) {
|
|
308
308
|
let pbjs = cloneDeep(config);
|
|
@@ -347,5 +347,87 @@ describe('Digital Garage Keyword Module', function () {
|
|
|
347
347
|
JSON.stringify(DUMMY_RESPONSE)
|
|
348
348
|
);
|
|
349
349
|
});
|
|
350
|
+
it('change url.', function (done) {
|
|
351
|
+
const dummyUrl = 'https://www.test.com/test'
|
|
352
|
+
let pbjs = cloneDeep(config);
|
|
353
|
+
pbjs.adUnits = cloneDeep(AD_UNITS);
|
|
354
|
+
if (IGNORE_SET_ORTB2) {
|
|
355
|
+
pbjs._ignoreSetOrtb2 = true;
|
|
356
|
+
}
|
|
357
|
+
let moduleConfig = cloneDeep(DEF_CONFIG);
|
|
358
|
+
moduleConfig.params.url = dummyUrl;
|
|
359
|
+
dgRtd.getDgKeywordsAndSet(
|
|
360
|
+
pbjs,
|
|
361
|
+
() => {
|
|
362
|
+
const url = dgRtd.getProfileApiUrl(dummyUrl);
|
|
363
|
+
expect(url.indexOf('?fpid=') === -1).to.equal(true);
|
|
364
|
+
expect(url).to.equal(server.requests[0].url);
|
|
365
|
+
done();
|
|
366
|
+
},
|
|
367
|
+
moduleConfig,
|
|
368
|
+
null
|
|
369
|
+
);
|
|
370
|
+
const request = server.requests[0];
|
|
371
|
+
request.respond(
|
|
372
|
+
200,
|
|
373
|
+
DUMMY_RESPONSE_HEADER,
|
|
374
|
+
JSON.stringify(DUMMY_RESPONSE)
|
|
375
|
+
);
|
|
376
|
+
});
|
|
377
|
+
it('add fpid stored in local strage.', function (done) {
|
|
378
|
+
const uuid = 'uuid_abcdefghijklmnopqrstuvwxyz';
|
|
379
|
+
let pbjs = cloneDeep(config);
|
|
380
|
+
pbjs.adUnits = cloneDeep(AD_UNITS);
|
|
381
|
+
if (IGNORE_SET_ORTB2) {
|
|
382
|
+
pbjs._ignoreSetOrtb2 = true;
|
|
383
|
+
}
|
|
384
|
+
let moduleConfig = cloneDeep(DEF_CONFIG);
|
|
385
|
+
window.localStorage.setItem('ope_fpid', uuid);
|
|
386
|
+
dgRtd.getDgKeywordsAndSet(
|
|
387
|
+
pbjs,
|
|
388
|
+
() => {
|
|
389
|
+
const url = dgRtd.getProfileApiUrl(null);
|
|
390
|
+
expect(url.indexOf(uuid) > 0).to.equal(true);
|
|
391
|
+
expect(url).to.equal(server.requests[0].url);
|
|
392
|
+
done();
|
|
393
|
+
},
|
|
394
|
+
moduleConfig,
|
|
395
|
+
null
|
|
396
|
+
);
|
|
397
|
+
const request = server.requests[0];
|
|
398
|
+
request.respond(
|
|
399
|
+
200,
|
|
400
|
+
DUMMY_RESPONSE_HEADER,
|
|
401
|
+
JSON.stringify(DUMMY_RESPONSE)
|
|
402
|
+
);
|
|
403
|
+
});
|
|
404
|
+
it('disable fpid stored in local strage.', function (done) {
|
|
405
|
+
const uuid = 'uuid_abcdefghijklmnopqrstuvwxyz';
|
|
406
|
+
let pbjs = cloneDeep(config);
|
|
407
|
+
pbjs.adUnits = cloneDeep(AD_UNITS);
|
|
408
|
+
if (IGNORE_SET_ORTB2) {
|
|
409
|
+
pbjs._ignoreSetOrtb2 = true;
|
|
410
|
+
}
|
|
411
|
+
let moduleConfig = cloneDeep(DEF_CONFIG);
|
|
412
|
+
window.localStorage.setItem('ope_fpid', uuid);
|
|
413
|
+
moduleConfig.params.disableReadFpid = true;
|
|
414
|
+
dgRtd.getDgKeywordsAndSet(
|
|
415
|
+
pbjs,
|
|
416
|
+
() => {
|
|
417
|
+
const url = dgRtd.getProfileApiUrl(null, moduleConfig.params.disableReadFpid);
|
|
418
|
+
expect(url.indexOf(uuid) > 0).to.equal(false);
|
|
419
|
+
expect(url).to.equal(server.requests[0].url);
|
|
420
|
+
done();
|
|
421
|
+
},
|
|
422
|
+
moduleConfig,
|
|
423
|
+
null
|
|
424
|
+
);
|
|
425
|
+
const request = server.requests[0];
|
|
426
|
+
request.respond(
|
|
427
|
+
200,
|
|
428
|
+
DUMMY_RESPONSE_HEADER,
|
|
429
|
+
JSON.stringify(DUMMY_RESPONSE)
|
|
430
|
+
);
|
|
431
|
+
});
|
|
350
432
|
});
|
|
351
433
|
});
|
|
@@ -159,14 +159,13 @@ describe('Dianomi adapter', () => {
|
|
|
159
159
|
{
|
|
160
160
|
bidId: 'bidId',
|
|
161
161
|
params: { smartadId: 1234 },
|
|
162
|
-
transactionId: 'transactionId',
|
|
163
162
|
},
|
|
164
163
|
];
|
|
165
164
|
let request = JSON.parse(
|
|
166
|
-
spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data
|
|
165
|
+
spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' }, auctionId: 'tid' }).data
|
|
167
166
|
);
|
|
168
167
|
|
|
169
|
-
assert.equal(request.source.tid,
|
|
168
|
+
assert.equal(request.source.tid, 'tid');
|
|
170
169
|
assert.equal(request.source.fd, 1);
|
|
171
170
|
});
|
|
172
171
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { getRefererInfo } from 'src/refererDetection.js';
|
|
3
|
-
import {
|
|
3
|
+
import {processFpd, coreStorage, resetEnrichments} from 'modules/enrichmentFpdModule.js';
|
|
4
|
+
import * as enrichmentModule from 'modules/enrichmentFpdModule.js';
|
|
5
|
+
import {GreedyPromise} from '../../../src/utils/promise.js';
|
|
4
6
|
|
|
5
7
|
describe('the first party data enrichment module', function() {
|
|
6
8
|
let width;
|
|
@@ -11,6 +13,8 @@ describe('the first party data enrichment module', function() {
|
|
|
11
13
|
let coreStorageStub;
|
|
12
14
|
let canonical;
|
|
13
15
|
let keywords;
|
|
16
|
+
let lowEntropySuaStub;
|
|
17
|
+
let highEntropySuaStub;
|
|
14
18
|
|
|
15
19
|
before(function() {
|
|
16
20
|
canonical = document.createElement('link');
|
|
@@ -20,6 +24,7 @@ describe('the first party data enrichment module', function() {
|
|
|
20
24
|
});
|
|
21
25
|
|
|
22
26
|
beforeEach(function() {
|
|
27
|
+
resetEnrichments();
|
|
23
28
|
querySelectorStub = sinon.stub(window.top.document, 'querySelector');
|
|
24
29
|
querySelectorStub.withArgs("link[rel='canonical']").returns(canonical);
|
|
25
30
|
querySelectorStub.withArgs("meta[name='keywords']").returns(keywords);
|
|
@@ -35,6 +40,8 @@ describe('the first party data enrichment module', function() {
|
|
|
35
40
|
.returns(null) // co.uk
|
|
36
41
|
.onSecondCall()
|
|
37
42
|
.returns('writeable'); // domain.co.uk
|
|
43
|
+
lowEntropySuaStub = sinon.stub(enrichmentModule.sua, 'le').callsFake(() => null);
|
|
44
|
+
highEntropySuaStub = sinon.stub(enrichmentModule.sua, 'he').callsFake(() => GreedyPromise.resolve());
|
|
38
45
|
});
|
|
39
46
|
|
|
40
47
|
afterEach(function() {
|
|
@@ -46,13 +53,21 @@ describe('the first party data enrichment module', function() {
|
|
|
46
53
|
canonical.rel = 'canonical';
|
|
47
54
|
keywords = document.createElement('meta');
|
|
48
55
|
keywords.name = 'keywords';
|
|
56
|
+
lowEntropySuaStub.restore();
|
|
57
|
+
highEntropySuaStub.restore();
|
|
49
58
|
});
|
|
50
59
|
|
|
60
|
+
function syncProcessFpd(fpdConf, ortb2Fragments) {
|
|
61
|
+
let result;
|
|
62
|
+
processFpd(fpdConf, ortb2Fragments).then((res) => { result = res; });
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
|
|
51
66
|
it('adds ref and device values', function() {
|
|
52
67
|
width = 800;
|
|
53
68
|
height = 500;
|
|
54
69
|
|
|
55
|
-
let validated =
|
|
70
|
+
let validated = syncProcessFpd({}, {}).global;
|
|
56
71
|
|
|
57
72
|
const {ref, page, domain} = getRefererInfo();
|
|
58
73
|
expect(validated.site.ref).to.equal(ref || undefined);
|
|
@@ -67,7 +82,7 @@ describe('the first party data enrichment module', function() {
|
|
|
67
82
|
height = 500;
|
|
68
83
|
canonical.href = 'https://www.subdomain.domain.co.uk/path?query=12345';
|
|
69
84
|
|
|
70
|
-
let validated =
|
|
85
|
+
let validated = syncProcessFpd({}, {}).global;
|
|
71
86
|
|
|
72
87
|
expect(validated.site.ref).to.equal(getRefererInfo().ref || undefined);
|
|
73
88
|
expect(validated.site.page).to.equal('https://www.subdomain.domain.co.uk/path?query=12345');
|
|
@@ -82,7 +97,7 @@ describe('the first party data enrichment module', function() {
|
|
|
82
97
|
height = 500;
|
|
83
98
|
keywords.content = 'value1,value2,value3';
|
|
84
99
|
|
|
85
|
-
let validated =
|
|
100
|
+
let validated = syncProcessFpd({}, {}).global;
|
|
86
101
|
|
|
87
102
|
expect(validated.site.keywords).to.equal('value1,value2,value3');
|
|
88
103
|
});
|
|
@@ -91,7 +106,7 @@ describe('the first party data enrichment module', function() {
|
|
|
91
106
|
width = 800;
|
|
92
107
|
height = 500;
|
|
93
108
|
|
|
94
|
-
let validated =
|
|
109
|
+
let validated = syncProcessFpd({}, {global: {device: {w: 1200, h: 700}, site: {ref: 'https://someUrl.com', page: 'test.com'}}}).global;
|
|
95
110
|
|
|
96
111
|
expect(validated.site.ref).to.equal('https://someUrl.com');
|
|
97
112
|
expect(validated.site.page).to.equal('test.com');
|
|
@@ -99,16 +114,44 @@ describe('the first party data enrichment module', function() {
|
|
|
99
114
|
expect(validated.site.keywords).to.be.undefined;
|
|
100
115
|
});
|
|
101
116
|
|
|
117
|
+
it('does not run enrichments again on the second call', () => {
|
|
118
|
+
width = 1;
|
|
119
|
+
height = 2;
|
|
120
|
+
const first = syncProcessFpd({}, {}).global;
|
|
121
|
+
width = 3;
|
|
122
|
+
const second = syncProcessFpd({}, {}).global;
|
|
123
|
+
expect(first).to.eql(second);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
describe('device.sua', () => {
|
|
127
|
+
it('does not set device.sua if resolved sua is null', () => {
|
|
128
|
+
const sua = syncProcessFpd({}, {}).global.device?.sua;
|
|
129
|
+
expect(sua).to.not.exist;
|
|
130
|
+
});
|
|
131
|
+
it('uses low entropy values if uaHints is []', () => {
|
|
132
|
+
lowEntropySuaStub.callsFake(() => ({mock: 'sua'}));
|
|
133
|
+
const sua = syncProcessFpd({uaHints: []}, {}).global.device.sua;
|
|
134
|
+
expect(sua).to.eql({mock: 'sua'});
|
|
135
|
+
});
|
|
136
|
+
it('uses high entropy values otherwise', () => {
|
|
137
|
+
highEntropySuaStub.callsFake((hints) => GreedyPromise.resolve({hints}));
|
|
138
|
+
const sua = syncProcessFpd({uaHints: ['h1', 'h2']}, {}).global.device.sua;
|
|
139
|
+
expect(sua).to.eql({hints: ['h1', 'h2']});
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
|
|
102
143
|
it('should store a reference to gpc witin ortb2.regs.ext if it has been enabled', function() {
|
|
103
144
|
let validated;
|
|
104
145
|
width = 800;
|
|
105
146
|
height = 500;
|
|
106
147
|
|
|
107
|
-
validated =
|
|
148
|
+
validated = syncProcessFpd({}, {}).global;
|
|
108
149
|
expect(validated.regs).to.equal(undefined);
|
|
109
150
|
|
|
151
|
+
resetEnrichments();
|
|
152
|
+
|
|
110
153
|
const globalPrivacyControlStub = sinon.stub(window, 'navigator').value({globalPrivacyControl: true});
|
|
111
|
-
validated =
|
|
154
|
+
validated = syncProcessFpd({}, {}).global;
|
|
112
155
|
expect(validated.regs.ext.gpc).to.equal(1);
|
|
113
156
|
globalPrivacyControlStub.restore();
|
|
114
157
|
});
|
|
@@ -4,6 +4,8 @@ import {getRefererInfo} from 'src/refererDetection.js';
|
|
|
4
4
|
import {processFpd, registerSubmodules, startAuctionHook, reset} from 'modules/fpdModule/index.js';
|
|
5
5
|
import * as enrichmentModule from 'modules/enrichmentFpdModule.js';
|
|
6
6
|
import * as validationModule from 'modules/validationFpdModule/index.js';
|
|
7
|
+
import {resetEnrichments} from 'modules/enrichmentFpdModule.js';
|
|
8
|
+
import {GreedyPromise} from '../../../src/utils/promise.js';
|
|
7
9
|
|
|
8
10
|
describe('the first party data module', function () {
|
|
9
11
|
afterEach(function () {
|
|
@@ -57,6 +59,8 @@ describe('the first party data module', function () {
|
|
|
57
59
|
let querySelectorStub;
|
|
58
60
|
let canonical;
|
|
59
61
|
let keywords;
|
|
62
|
+
let lowEntropySuaStub;
|
|
63
|
+
let highEntropySuaStub;
|
|
60
64
|
|
|
61
65
|
before(function() {
|
|
62
66
|
reset();
|
|
@@ -70,6 +74,7 @@ describe('the first party data module', function () {
|
|
|
70
74
|
});
|
|
71
75
|
|
|
72
76
|
beforeEach(function() {
|
|
77
|
+
resetEnrichments();
|
|
73
78
|
querySelectorStub = sinon.stub(window.top.document, 'querySelector');
|
|
74
79
|
querySelectorStub.withArgs("link[rel='canonical']").returns(canonical);
|
|
75
80
|
querySelectorStub.withArgs("meta[name='keywords']").returns(keywords);
|
|
@@ -79,6 +84,8 @@ describe('the first party data module', function () {
|
|
|
79
84
|
heightStub = sinon.stub(window.top, 'innerHeight').get(function () {
|
|
80
85
|
return height;
|
|
81
86
|
});
|
|
87
|
+
lowEntropySuaStub = sinon.stub(enrichmentModule.sua, 'le').callsFake(() => null);
|
|
88
|
+
highEntropySuaStub = sinon.stub(enrichmentModule.sua, 'he').callsFake(() => GreedyPromise.resolve());
|
|
82
89
|
});
|
|
83
90
|
|
|
84
91
|
afterEach(function() {
|
|
@@ -89,6 +96,8 @@ describe('the first party data module', function () {
|
|
|
89
96
|
canonical.rel = 'canonical';
|
|
90
97
|
keywords = document.createElement('meta');
|
|
91
98
|
keywords.name = 'keywords';
|
|
99
|
+
lowEntropySuaStub.restore();
|
|
100
|
+
highEntropySuaStub.restore();
|
|
92
101
|
});
|
|
93
102
|
|
|
94
103
|
it('filters ortb2 data that is set', function () {
|
|
@@ -126,7 +126,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
126
126
|
genre: 'Adventure'
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
const request = spec.buildRequests([bidRequests[0]], {...bidderRequest, ortb2: {site}});
|
|
129
|
+
const [request] = spec.buildRequests([bidRequests[0]], {...bidderRequest, ortb2: {site}});
|
|
130
130
|
const payload = parseRequest(request.data);
|
|
131
131
|
expect(payload.site.cat).to.deep.equal([...site.cat, ...site.pagecat]);
|
|
132
132
|
expect(payload.site.content.genre).to.deep.equal(site.content.genre);
|
|
@@ -137,7 +137,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
137
137
|
const getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage').callsFake(
|
|
138
138
|
arg => arg === 'tmguid' ? fpdUserIdVal : null);
|
|
139
139
|
|
|
140
|
-
const request = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
140
|
+
const [request] = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
141
141
|
expect(request.data).to.be.an('string');
|
|
142
142
|
const payload = parseRequest(request.data);
|
|
143
143
|
expect(payload).to.deep.equal({
|
|
@@ -174,7 +174,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
174
174
|
const getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage').callsFake(
|
|
175
175
|
arg => arg === 'tmguid' ? fpdUserIdVal : null);
|
|
176
176
|
|
|
177
|
-
const request = spec.buildRequests([bidRequests[0], bidRequests[1]], bidderRequest);
|
|
177
|
+
const [request] = spec.buildRequests([bidRequests[0], bidRequests[1]], bidderRequest);
|
|
178
178
|
expect(request.data).to.be.an('string');
|
|
179
179
|
const payload = parseRequest(request.data);
|
|
180
180
|
expect(payload).to.deep.equal({
|
|
@@ -220,7 +220,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
220
220
|
const getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage').callsFake(
|
|
221
221
|
arg => arg === 'tmguid' ? fpdUserIdVal : null);
|
|
222
222
|
|
|
223
|
-
const request = spec.buildRequests(bidRequests.slice(0, 3), bidderRequest);
|
|
223
|
+
const [request] = spec.buildRequests(bidRequests.slice(0, 3), bidderRequest);
|
|
224
224
|
expect(request.data).to.be.an('string');
|
|
225
225
|
const payload = parseRequest(request.data);
|
|
226
226
|
expect(payload).to.deep.equal({
|
|
@@ -270,12 +270,68 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
270
270
|
getDataFromLocalStorageStub.restore();
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
+
it('should attach valid params to the tags with multiRequest', function () {
|
|
274
|
+
const fpdUserIdVal = '0b0f84a1-1596-4165-9742-2e1a7dfac57f';
|
|
275
|
+
const getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage').callsFake(
|
|
276
|
+
arg => arg === 'tmguid' ? fpdUserIdVal : null);
|
|
277
|
+
|
|
278
|
+
const bidMultiRequests = bidRequests.slice(0, 3).map((bidReq) => ({
|
|
279
|
+
...bidReq,
|
|
280
|
+
params: { ...bidReq.params, multiRequest: true }
|
|
281
|
+
}));
|
|
282
|
+
bidMultiRequests[1].params.pubid = 'some_pub_id';
|
|
283
|
+
bidMultiRequests[2].params.source = 'jwp';
|
|
284
|
+
const requests = spec.buildRequests(bidMultiRequests, bidderRequest);
|
|
285
|
+
requests.forEach((request, i) => {
|
|
286
|
+
expect(request.data).to.be.an('string');
|
|
287
|
+
const payload = parseRequest(request.data);
|
|
288
|
+
const banner = bidMultiRequests[i].mediaTypes ? bidRequests[i].mediaTypes.banner : { sizes: bidMultiRequests[i].sizes };
|
|
289
|
+
const video = bidMultiRequests[i].mediaTypes && bidMultiRequests[i].mediaTypes.video;
|
|
290
|
+
const source = bidMultiRequests[i].params.source;
|
|
291
|
+
const url = `https://grid.bidswitch.net/hbjson?no_mapping=1${source ? `&sp=${source}` : ''}`;
|
|
292
|
+
expect(request.url).to.equal(url);
|
|
293
|
+
expect(payload).to.deep.equal({
|
|
294
|
+
'id': bidderRequest.bidderRequestId,
|
|
295
|
+
'site': {
|
|
296
|
+
'page': referrer,
|
|
297
|
+
...(bidMultiRequests[i].params.pubid && { 'publisher': { 'id': bidMultiRequests[i].params.pubid } })
|
|
298
|
+
},
|
|
299
|
+
'tmax': bidderRequest.timeout,
|
|
300
|
+
'source': {
|
|
301
|
+
'tid': bidderRequest.auctionId,
|
|
302
|
+
'ext': {'wrapper': 'Prebid_js', 'wrapper_version': '$prebid.version$'}
|
|
303
|
+
},
|
|
304
|
+
'user': {
|
|
305
|
+
'id': fpdUserIdVal
|
|
306
|
+
},
|
|
307
|
+
'imp': [{
|
|
308
|
+
'id': bidMultiRequests[i].bidId,
|
|
309
|
+
'tagid': bidMultiRequests[i].params.uid,
|
|
310
|
+
'ext': {'divid': bidMultiRequests[i].adUnitCode},
|
|
311
|
+
...(bidMultiRequests[i].params.bidFloor && { 'bidfloor': bidMultiRequests[i].params.bidFloor }),
|
|
312
|
+
...(banner && { banner: {
|
|
313
|
+
'w': banner.sizes[0][0],
|
|
314
|
+
'h': banner.sizes[0][1],
|
|
315
|
+
'format': banner.sizes.map(([w, h]) => ({ w, h }))
|
|
316
|
+
}}),
|
|
317
|
+
...(video && { video: {
|
|
318
|
+
'w': video.playerSize[0][0],
|
|
319
|
+
'h': video.playerSize[0][1],
|
|
320
|
+
'mimes': video.mimes
|
|
321
|
+
}})
|
|
322
|
+
}]
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
getDataFromLocalStorageStub.restore();
|
|
327
|
+
});
|
|
328
|
+
|
|
273
329
|
it('should support mixed mediaTypes', function () {
|
|
274
330
|
const fpdUserIdVal = '0b0f84a1-1596-4165-9742-2e1a7dfac57f';
|
|
275
331
|
const getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage').callsFake(
|
|
276
332
|
arg => arg === 'tmguid' ? fpdUserIdVal : null);
|
|
277
333
|
|
|
278
|
-
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
334
|
+
const [request] = spec.buildRequests(bidRequests, bidderRequest);
|
|
279
335
|
expect(request.data).to.be.an('string');
|
|
280
336
|
const payload = parseRequest(request.data);
|
|
281
337
|
expect(payload).to.deep.equal({
|
|
@@ -341,7 +397,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
341
397
|
|
|
342
398
|
it('if gdprConsent is present payload must have gdpr params', function () {
|
|
343
399
|
const gdprBidderRequest = Object.assign({gdprConsent: {consentString: 'AAA', gdprApplies: true}}, bidderRequest);
|
|
344
|
-
const request = spec.buildRequests(bidRequests, gdprBidderRequest);
|
|
400
|
+
const [request] = spec.buildRequests(bidRequests, gdprBidderRequest);
|
|
345
401
|
expect(request.data).to.be.an('string');
|
|
346
402
|
const payload = parseRequest(request.data);
|
|
347
403
|
expect(payload).to.have.property('user');
|
|
@@ -354,7 +410,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
354
410
|
|
|
355
411
|
it('if usPrivacy is present payload must have us_privacy param', function () {
|
|
356
412
|
const bidderRequestWithUSP = Object.assign({uspConsent: '1YNN'}, bidderRequest);
|
|
357
|
-
const request = spec.buildRequests(bidRequests, bidderRequestWithUSP);
|
|
413
|
+
const [request] = spec.buildRequests(bidRequests, bidderRequestWithUSP);
|
|
358
414
|
expect(request.data).to.be.an('string');
|
|
359
415
|
const payload = parseRequest(request.data);
|
|
360
416
|
expect(payload).to.have.property('regs');
|
|
@@ -387,7 +443,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
387
443
|
userIdAsEids: eids
|
|
388
444
|
}, bid);
|
|
389
445
|
});
|
|
390
|
-
const request = spec.buildRequests(bidRequestsWithUserIds, bidderRequest);
|
|
446
|
+
const [request] = spec.buildRequests(bidRequestsWithUserIds, bidderRequest);
|
|
391
447
|
expect(request.data).to.be.an('string');
|
|
392
448
|
const payload = parseRequest(request.data);
|
|
393
449
|
expect(payload).to.have.property('user');
|
|
@@ -403,7 +459,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
403
459
|
};
|
|
404
460
|
const ortb2 = {user: {ext: {device: ortb2UserExtDevice}}};
|
|
405
461
|
|
|
406
|
-
const request = spec.buildRequests(bidRequests, {...bidderRequest, ortb2});
|
|
462
|
+
const [request] = spec.buildRequests(bidRequests, {...bidderRequest, ortb2});
|
|
407
463
|
expect(request.data).to.be.an('string');
|
|
408
464
|
const payload = parseRequest(request.data);
|
|
409
465
|
expect(payload).to.have.property('user');
|
|
@@ -427,7 +483,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
427
483
|
schain: schain
|
|
428
484
|
}, bid);
|
|
429
485
|
});
|
|
430
|
-
const request = spec.buildRequests(bidRequestsWithSChain, bidderRequest);
|
|
486
|
+
const [request] = spec.buildRequests(bidRequestsWithSChain, bidderRequest);
|
|
431
487
|
expect(request.data).to.be.an('string');
|
|
432
488
|
const payload = parseRequest(request.data);
|
|
433
489
|
expect(payload).to.have.property('source');
|
|
@@ -451,7 +507,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
451
507
|
}
|
|
452
508
|
}, bid);
|
|
453
509
|
});
|
|
454
|
-
const request = spec.buildRequests(bidRequestsWithJwTargeting, bidderRequest);
|
|
510
|
+
const [request] = spec.buildRequests(bidRequestsWithJwTargeting, bidderRequest);
|
|
455
511
|
expect(request.data).to.be.an('string');
|
|
456
512
|
const payload = parseRequest(request.data);
|
|
457
513
|
expect(payload).to.have.property('user');
|
|
@@ -494,7 +550,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
494
550
|
}
|
|
495
551
|
};
|
|
496
552
|
const bidRequestWithKW = { ...bidRequests[0], params: { ...bidRequests[0].params, keywords } }
|
|
497
|
-
const request = spec.buildRequests([bidRequestWithKW], {...bidderRequest, ortb2});
|
|
553
|
+
const [request] = spec.buildRequests([bidRequestWithKW], {...bidderRequest, ortb2});
|
|
498
554
|
expect(request.data).to.be.an('string');
|
|
499
555
|
const payload = parseRequest(request.data);
|
|
500
556
|
expect(payload.ext.keywords).to.deep.equal({
|
|
@@ -556,7 +612,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
556
612
|
}
|
|
557
613
|
];
|
|
558
614
|
const ortb2 = {user: {data: userData}};
|
|
559
|
-
const request = spec.buildRequests([bidRequests[0]], {...bidderRequest, ortb2});
|
|
615
|
+
const [request] = spec.buildRequests([bidRequests[0]], {...bidderRequest, ortb2});
|
|
560
616
|
const payload = parseRequest(request.data);
|
|
561
617
|
expect(payload.user.data).to.deep.equal(userData);
|
|
562
618
|
});
|
|
@@ -575,7 +631,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
575
631
|
}
|
|
576
632
|
];
|
|
577
633
|
const ortb2 = {site: { content: { data: contentData } }};
|
|
578
|
-
const request = spec.buildRequests([bidRequests[0]], {...bidderRequest, ortb2});
|
|
634
|
+
const [request] = spec.buildRequests([bidRequests[0]], {...bidderRequest, ortb2});
|
|
579
635
|
const payload = parseRequest(request.data);
|
|
580
636
|
expect(payload.site.content.data).to.deep.equal(contentData);
|
|
581
637
|
});
|
|
@@ -608,7 +664,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
608
664
|
}
|
|
609
665
|
}
|
|
610
666
|
});
|
|
611
|
-
const request = spec.buildRequests([bidRequestsWithJwTargeting], {...bidderRequest, ortb2});
|
|
667
|
+
const [request] = spec.buildRequests([bidRequestsWithJwTargeting], {...bidderRequest, ortb2});
|
|
612
668
|
const payload = parseRequest(request.data);
|
|
613
669
|
expect(payload.user.data).to.deep.equal([{
|
|
614
670
|
name: 'iow_labs_pub_data',
|
|
@@ -622,7 +678,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
622
678
|
it('should have site.content.id filled from config ortb2.site.content.id', function () {
|
|
623
679
|
const contentId = 'jw_abc';
|
|
624
680
|
const ortb2 = {site: {content: {id: contentId}}};
|
|
625
|
-
const request = spec.buildRequests([bidRequests[0]], {...bidderRequest, ortb2});
|
|
681
|
+
const [request] = spec.buildRequests([bidRequests[0]], {...bidderRequest, ortb2});
|
|
626
682
|
const payload = parseRequest(request.data);
|
|
627
683
|
expect(payload.site.content.id).to.equal(contentId);
|
|
628
684
|
});
|
|
@@ -630,7 +686,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
630
686
|
it('should be right tmax when timeout in config is less then timeout in bidderRequest', function() {
|
|
631
687
|
const getConfigStub = sinon.stub(config, 'getConfig').callsFake(
|
|
632
688
|
arg => arg === 'bidderTimeout' ? 2000 : null);
|
|
633
|
-
const request = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
689
|
+
const [request] = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
634
690
|
expect(request.data).to.be.an('string');
|
|
635
691
|
const payload = parseRequest(request.data);
|
|
636
692
|
expect(payload.tmax).to.equal(2000);
|
|
@@ -639,7 +695,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
639
695
|
it('should be right tmax when timeout in bidderRequest is less then timeout in config', function() {
|
|
640
696
|
const getConfigStub = sinon.stub(config, 'getConfig').callsFake(
|
|
641
697
|
arg => arg === 'bidderTimeout' ? 5000 : null);
|
|
642
|
-
const request = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
698
|
+
const [request] = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
643
699
|
expect(request.data).to.be.an('string');
|
|
644
700
|
const payload = parseRequest(request.data);
|
|
645
701
|
expect(payload.tmax).to.equal(3000);
|
|
@@ -648,7 +704,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
648
704
|
it('should contain regs.coppa if coppa is true in config', function () {
|
|
649
705
|
const getConfigStub = sinon.stub(config, 'getConfig').callsFake(
|
|
650
706
|
arg => arg === 'coppa' ? true : null);
|
|
651
|
-
const request = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
707
|
+
const [request] = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
652
708
|
expect(request.data).to.be.an('string');
|
|
653
709
|
const payload = parseRequest(request.data);
|
|
654
710
|
expect(payload).to.have.property('regs');
|
|
@@ -680,7 +736,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
680
736
|
const bidRequestsWithOrtb2Imp = bidRequests.slice(0, 3).map((bid, ind) => {
|
|
681
737
|
return Object.assign(ortb2Imp[ind] ? { ortb2Imp: ortb2Imp[ind] } : {}, bid);
|
|
682
738
|
});
|
|
683
|
-
const request = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
|
|
739
|
+
const [request] = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
|
|
684
740
|
expect(request.data).to.be.an('string');
|
|
685
741
|
const payload = parseRequest(request.data);
|
|
686
742
|
expect(payload.imp[0].ext).to.deep.equal({
|
|
@@ -716,7 +772,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
716
772
|
const bidRequestsWithOrtb2Imp = bidRequests.slice(0, 3).map((bid, ind) => {
|
|
717
773
|
return Object.assign(ortb2Imp[ind] ? { ortb2Imp: ortb2Imp[ind] } : {}, bid);
|
|
718
774
|
});
|
|
719
|
-
const request = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
|
|
775
|
+
const [request] = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
|
|
720
776
|
expect(request.data).to.be.an('string');
|
|
721
777
|
const payload = parseRequest(request.data);
|
|
722
778
|
expect(payload.imp[0].instl).to.equal(1);
|
|
@@ -750,7 +806,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
750
806
|
timeout: 3000
|
|
751
807
|
};
|
|
752
808
|
const parsedReferrer = encodeURIComponent(bidderRequestWithNumId.refererInfo.page);
|
|
753
|
-
const request = spec.buildRequests([bidRequestWithNumId], bidderRequestWithNumId);
|
|
809
|
+
const [request] = spec.buildRequests([bidRequestWithNumId], bidderRequestWithNumId);
|
|
754
810
|
expect(request.data).to.be.an('string');
|
|
755
811
|
const payload = parseRequest(request.data);
|
|
756
812
|
expect(payload).to.deep.equal({
|
|
@@ -792,7 +848,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
792
848
|
}
|
|
793
849
|
}, bidRequests[1]);
|
|
794
850
|
it('should return the value from getFloor if present', function () {
|
|
795
|
-
const request = spec.buildRequests([bidRequest], bidderRequest);
|
|
851
|
+
const [request] = spec.buildRequests([bidRequest], bidderRequest);
|
|
796
852
|
expect(request.data).to.be.an('string');
|
|
797
853
|
const payload = parseRequest(request.data);
|
|
798
854
|
expect(payload.imp[0].bidfloor).to.equal(floorTestData.floor);
|
|
@@ -801,7 +857,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
801
857
|
const bidfloor = 0.80;
|
|
802
858
|
const bidRequestsWithFloor = { ...bidRequest };
|
|
803
859
|
bidRequestsWithFloor.params = Object.assign({bidFloor: bidfloor}, bidRequestsWithFloor.params);
|
|
804
|
-
const request = spec.buildRequests([bidRequestsWithFloor], bidderRequest);
|
|
860
|
+
const [request] = spec.buildRequests([bidRequestsWithFloor], bidderRequest);
|
|
805
861
|
expect(request.data).to.be.an('string');
|
|
806
862
|
const payload = parseRequest(request.data);
|
|
807
863
|
expect(payload.imp[0].bidfloor).to.equal(floorTestData.floor);
|
|
@@ -810,7 +866,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
810
866
|
const bidfloor = 1.80;
|
|
811
867
|
const bidRequestsWithFloor = { ...bidRequest };
|
|
812
868
|
bidRequestsWithFloor.params = Object.assign({bidFloor: bidfloor}, bidRequestsWithFloor.params);
|
|
813
|
-
const request = spec.buildRequests([bidRequestsWithFloor], bidderRequest);
|
|
869
|
+
const [request] = spec.buildRequests([bidRequestsWithFloor], bidderRequest);
|
|
814
870
|
expect(request.data).to.be.an('string');
|
|
815
871
|
const payload = parseRequest(request.data);
|
|
816
872
|
expect(payload.imp[0].bidfloor).to.equal(bidfloor);
|
|
@@ -844,7 +900,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
844
900
|
'auctionId': '1cbd2feafe5e8b',
|
|
845
901
|
}
|
|
846
902
|
];
|
|
847
|
-
const request = spec.buildRequests(bidRequests);
|
|
903
|
+
const [request] = spec.buildRequests(bidRequests);
|
|
848
904
|
const expectedResponse = [
|
|
849
905
|
{
|
|
850
906
|
'requestId': '659423fff799cb',
|
|
@@ -904,7 +960,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
904
960
|
'auctionId': '1fa09aee5c8c99',
|
|
905
961
|
}
|
|
906
962
|
];
|
|
907
|
-
const request = spec.buildRequests(bidRequests);
|
|
963
|
+
const [request] = spec.buildRequests(bidRequests);
|
|
908
964
|
const expectedResponse = [
|
|
909
965
|
{
|
|
910
966
|
'requestId': '659423fff799cb',
|
|
@@ -1050,7 +1106,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
1050
1106
|
{'bid': [{'impid': '112432ab4f34', 'price': 1.80, 'adm': '<VAST version=\"3.0\">\n<Ad id=\"32115432\"><\/Ad>\n<\/VAST>', 'nurl': 'https://wrong_url.com', 'auid': 14, content_type: 'video', 'adomain': ['example.com'], w: 300, h: 600}], 'seat': '2'},
|
|
1051
1107
|
{'bid': [{'impid': 'a74b342f8cd', 'price': 1.50, 'nurl': '', 'auid': 15, content_type: 'video'}], 'seat': '2'}
|
|
1052
1108
|
];
|
|
1053
|
-
const request = spec.buildRequests(bidRequests);
|
|
1109
|
+
const [request] = spec.buildRequests(bidRequests);
|
|
1054
1110
|
const expectedResponse = [
|
|
1055
1111
|
{
|
|
1056
1112
|
'requestId': '659423fff799cb',
|
|
@@ -1167,7 +1223,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
1167
1223
|
'auctionId': '1fa09aee5c84d34',
|
|
1168
1224
|
}
|
|
1169
1225
|
];
|
|
1170
|
-
const request = spec.buildRequests(bidRequests);
|
|
1226
|
+
const [request] = spec.buildRequests(bidRequests);
|
|
1171
1227
|
const result = spec.interpretResponse({'body': {'seatbid': responses.slice(2)}}, request);
|
|
1172
1228
|
expect(result.length).to.equal(0);
|
|
1173
1229
|
});
|
|
@@ -1237,7 +1293,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
1237
1293
|
'auctionId': '32a1f276cb87cb8',
|
|
1238
1294
|
}
|
|
1239
1295
|
];
|
|
1240
|
-
const request = spec.buildRequests(bidRequests);
|
|
1296
|
+
const [request] = spec.buildRequests(bidRequests);
|
|
1241
1297
|
const expectedResponse = [
|
|
1242
1298
|
{
|
|
1243
1299
|
'requestId': '2164be6358b9',
|
|
@@ -1344,7 +1400,7 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
1344
1400
|
],
|
|
1345
1401
|
'seat': '1'
|
|
1346
1402
|
};
|
|
1347
|
-
const request = spec.buildRequests(bidRequests);
|
|
1403
|
+
const [request] = spec.buildRequests(bidRequests);
|
|
1348
1404
|
const expectedResponse = [
|
|
1349
1405
|
{
|
|
1350
1406
|
'requestId': '26d6f897b516',
|