prebid.js 7.33.0 → 7.35.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/.devcontainer/devcontainer.json +2 -1
- package/.github/workflows/issue_tracker.yml +27 -16
- 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/admaticBidAdapter.js +1 -1
- package/dist/admixerBidAdapter.js +1 -1
- package/dist/adnuntiusBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.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/arcspanRtdProvider.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/bliinkBidAdapter.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/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.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/cwireBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/emx_digitalBidAdapter.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/hadronIdSystem.js +1 -1
- package/dist/holidBidAdapter.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/kargoBidAdapter.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/lotamePanoramaIdSystem.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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +140 -149
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/ortbConverter.js +1 -1
- 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/prebidServerBidAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pulsepointBidAdapter.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/smartytechBidAdapter.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/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/dist/zeusPrimeRtdProvider.js +4 -14
- package/integrationExamples/gpt/hello_world.html +0 -0
- package/libraries/ortbConverter/processors/default.js +19 -1
- package/modules/.submodules.json +1 -0
- package/modules/admaticBidAdapter.js +2 -1
- package/modules/admixerBidAdapter.js +26 -4
- package/modules/adnuntiusBidAdapter.js +36 -38
- package/modules/adyoulikeBidAdapter.js +2 -0
- package/modules/arcspanRtdProvider.js +73 -0
- package/modules/arcspanRtdProvider.md +11 -0
- package/modules/bliinkBidAdapter.js +1 -1
- package/modules/consentManagement.js +33 -5
- package/modules/consumableBidAdapter.js +20 -2
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/cwireBidAdapter.js +169 -242
- package/modules/cwireBidAdapter.md +15 -14
- package/modules/emx_digitalBidAdapter.js +9 -2
- package/modules/hadronIdSystem.js +37 -32
- package/modules/holidBidAdapter.js +9 -4
- package/modules/kargoBidAdapter.js +5 -1
- package/modules/lotamePanoramaIdSystem.js +9 -1
- package/modules/nextMillenniumBidAdapter.js +19 -9
- package/modules/nexx360BidAdapter.js +1 -2
- package/modules/onetagBidAdapter.js +12 -1
- package/modules/openxBidAdapter.js +5 -0
- package/modules/outbrainBidAdapter.js +103 -6
- package/modules/permutiveRtdProvider.js +17 -12
- package/modules/prebidServerBidAdapter/index.js +14 -1
- package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
- package/modules/priceFloors.js +7 -8
- package/modules/pulsepointBidAdapter.js +2 -0
- package/modules/seedingAllianceBidAdapter.js +129 -116
- package/modules/smartadserverBidAdapter.js +39 -28
- package/modules/smartyadsBidAdapter.md +9 -0
- package/modules/smartytechBidAdapter.js +67 -10
- package/modules/smartytechBidAdapter.md +44 -33
- package/modules/sonobiBidAdapter.js +17 -10
- package/modules/taboolaBidAdapter.js +2 -1
- package/modules/tripleliftBidAdapter.js +4 -0
- package/modules/vidazooBidAdapter.js +56 -22
- package/modules/zeta_global_sspBidAdapter.js +15 -0
- package/modules/zeusPrimeRtdProvider.js +3 -323
- package/modules/zeusPrimeRtdProvider.md +3 -0
- package/package.json +1 -1
- package/src/adloader.js +2 -1
- package/src/auction.js +2 -11
- package/src/prebid.js +8 -0
- package/src/utils/cpm.js +17 -0
- package/test/spec/modules/admixerBidAdapter_spec.js +140 -60
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +120 -120
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +3 -0
- package/test/spec/modules/arcspanRtdProvider_spec.js +187 -0
- package/test/spec/modules/bliinkBidAdapter_spec.js +7 -7
- package/test/spec/modules/consentManagement_spec.js +49 -1
- package/test/spec/modules/consumableBidAdapter_spec.js +46 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +249 -335
- package/test/spec/modules/emx_digitalBidAdapter_spec.js +30 -1
- package/test/spec/modules/hadronIdSystem_spec.js +4 -6
- package/test/spec/modules/holidBidAdapter_spec.js +29 -0
- package/test/spec/modules/kargoBidAdapter_spec.js +32 -0
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +16 -10
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +14 -2
- package/test/spec/modules/nexx360BidAdapter_spec.js +0 -4
- package/test/spec/modules/onetagBidAdapter_spec.js +43 -0
- package/test/spec/modules/openxBidAdapter_spec.js +41 -0
- package/test/spec/modules/openxOrtbBidAdapter_spec.js +41 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +182 -18
- package/test/spec/modules/prebidServerBidAdapter_spec.js +138 -0
- package/test/spec/modules/pulsepointBidAdapter_spec.js +11 -1
- package/test/spec/modules/seedingAllianceAdapter_spec.js +66 -23
- package/test/spec/modules/smartadserverBidAdapter_spec.js +116 -5
- package/test/spec/modules/smartytechBidAdapter_spec.js +172 -14
- package/test/spec/modules/sonobiBidAdapter_spec.js +2 -1
- package/test/spec/modules/taboolaBidAdapter_spec.js +12 -3
- package/test/spec/modules/tripleliftBidAdapter_spec.js +13 -0
- package/test/spec/modules/userId_spec.js +19 -14
- package/test/spec/modules/vidazooBidAdapter_spec.js +61 -22
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +8 -0
- package/test/spec/ortbConverter/default_processors_spec.js +23 -0
- package/test/spec/unit/pbjs_api_spec.js +14 -0
- package/test/spec/unit/utils/cpm_spec.js +64 -0
- package/test/spec/modules/zeusPrimeRtdProvider_spec.js +0 -410
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {expect} from 'chai';
|
|
2
2
|
import {
|
|
3
3
|
spec as adapter,
|
|
4
4
|
SUPPORTED_ID_SYSTEMS,
|
|
@@ -15,9 +15,10 @@ import {
|
|
|
15
15
|
getVidazooSessionId,
|
|
16
16
|
} from 'modules/vidazooBidAdapter.js';
|
|
17
17
|
import * as utils from 'src/utils.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import {version} from 'package.json';
|
|
19
|
+
import {useFakeTimers} from 'sinon';
|
|
20
|
+
import {BANNER, VIDEO} from '../../../src/mediaTypes';
|
|
21
|
+
import {config} from '../../../src/config';
|
|
21
22
|
|
|
22
23
|
const SUB_DOMAIN = 'openrtb';
|
|
23
24
|
|
|
@@ -38,6 +39,10 @@ const BID = {
|
|
|
38
39
|
'transactionId': 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
|
|
39
40
|
'sizes': [[300, 250], [300, 600]],
|
|
40
41
|
'bidderRequestId': '1fdb5ff1b6eaa7',
|
|
42
|
+
'auctionId': 'auction_id',
|
|
43
|
+
'bidRequestsCount': 4,
|
|
44
|
+
'bidderRequestsCount': 3,
|
|
45
|
+
'bidderWinsCount': 1,
|
|
41
46
|
'requestId': 'b0777d85-d061-450e-9bc7-260dd54bbb7a',
|
|
42
47
|
'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
|
|
43
48
|
'mediaTypes': [BANNER],
|
|
@@ -53,6 +58,10 @@ const VIDEO_BID = {
|
|
|
53
58
|
'adUnitCode': '63550ad1ff6642d368cba59dh5884270560',
|
|
54
59
|
'bidderRequestId': '12a8ae9ada9c13',
|
|
55
60
|
'transactionId': '56e184c6-bde9-497b-b9b9-cf47a61381ee',
|
|
61
|
+
'auctionId': 'auction_id',
|
|
62
|
+
'bidRequestsCount': 4,
|
|
63
|
+
'bidderRequestsCount': 3,
|
|
64
|
+
'bidderWinsCount': 1,
|
|
56
65
|
'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
|
|
57
66
|
'params': {
|
|
58
67
|
'subDomain': SUB_DOMAIN,
|
|
@@ -85,6 +94,8 @@ const BIDDER_REQUEST = {
|
|
|
85
94
|
'consentString': 'consent_string',
|
|
86
95
|
'gdprApplies': true
|
|
87
96
|
},
|
|
97
|
+
'gppString': 'gpp_string',
|
|
98
|
+
'gppSid': [7],
|
|
88
99
|
'uspConsent': 'consent_string',
|
|
89
100
|
'refererInfo': {
|
|
90
101
|
'page': 'https://www.greatsite.com',
|
|
@@ -94,6 +105,10 @@ const BIDDER_REQUEST = {
|
|
|
94
105
|
'site': {
|
|
95
106
|
'cat': ['IAB2'],
|
|
96
107
|
'pagecat': ['IAB2-2']
|
|
108
|
+
},
|
|
109
|
+
'regs': {
|
|
110
|
+
'gpp': 'gpp_string',
|
|
111
|
+
'gpp_sid': [7]
|
|
97
112
|
}
|
|
98
113
|
},
|
|
99
114
|
};
|
|
@@ -147,7 +162,7 @@ const REQUEST = {
|
|
|
147
162
|
|
|
148
163
|
function getTopWindowQueryParams() {
|
|
149
164
|
try {
|
|
150
|
-
const parsedUrl = utils.parseUrl(window.top.document.URL, {
|
|
165
|
+
const parsedUrl = utils.parseUrl(window.top.document.URL, {decodeSearchAsString: true});
|
|
151
166
|
return parsedUrl.search;
|
|
152
167
|
} catch (e) {
|
|
153
168
|
return '';
|
|
@@ -226,6 +241,9 @@ describe('VidazooBidAdapter', function () {
|
|
|
226
241
|
|
|
227
242
|
it('should build video request', function () {
|
|
228
243
|
const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
|
|
244
|
+
config.setConfig({
|
|
245
|
+
bidderTimeout: 3000
|
|
246
|
+
});
|
|
229
247
|
const requests = adapter.buildRequests([VIDEO_BID], BIDDER_REQUEST);
|
|
230
248
|
expect(requests).to.have.length(1);
|
|
231
249
|
expect(requests[0]).to.deep.equal({
|
|
@@ -243,6 +261,15 @@ describe('VidazooBidAdapter', function () {
|
|
|
243
261
|
gdpr: 1,
|
|
244
262
|
gdprConsent: 'consent_string',
|
|
245
263
|
usPrivacy: 'consent_string',
|
|
264
|
+
gppString: 'gpp_string',
|
|
265
|
+
gppSid: [7],
|
|
266
|
+
auctionId: 'auction_id',
|
|
267
|
+
bidRequestsCount: 4,
|
|
268
|
+
bidderRequestsCount: 3,
|
|
269
|
+
bidderWinsCount: 1,
|
|
270
|
+
bidderTimeout: 3000,
|
|
271
|
+
transactionId: '56e184c6-bde9-497b-b9b9-cf47a61381ee',
|
|
272
|
+
bidderRequestId: '12a8ae9ada9c13',
|
|
246
273
|
gpid: '',
|
|
247
274
|
prebidVersion: version,
|
|
248
275
|
ptrace: '1000',
|
|
@@ -278,6 +305,9 @@ describe('VidazooBidAdapter', function () {
|
|
|
278
305
|
});
|
|
279
306
|
|
|
280
307
|
it('should build banner request for each size', function () {
|
|
308
|
+
config.setConfig({
|
|
309
|
+
bidderTimeout: 3000
|
|
310
|
+
});
|
|
281
311
|
const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
|
|
282
312
|
const requests = adapter.buildRequests([BID], BIDDER_REQUEST);
|
|
283
313
|
expect(requests).to.have.length(1);
|
|
@@ -288,6 +318,15 @@ describe('VidazooBidAdapter', function () {
|
|
|
288
318
|
gdprConsent: 'consent_string',
|
|
289
319
|
gdpr: 1,
|
|
290
320
|
usPrivacy: 'consent_string',
|
|
321
|
+
gppString: 'gpp_string',
|
|
322
|
+
gppSid: [7],
|
|
323
|
+
auctionId: 'auction_id',
|
|
324
|
+
bidRequestsCount: 4,
|
|
325
|
+
bidderRequestsCount: 3,
|
|
326
|
+
bidderWinsCount: 1,
|
|
327
|
+
bidderTimeout: 3000,
|
|
328
|
+
transactionId: 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
|
|
329
|
+
bidderRequestId: '1fdb5ff1b6eaa7',
|
|
291
330
|
sizes: ['300x250', '300x600'],
|
|
292
331
|
url: 'https%3A%2F%2Fwww.greatsite.com',
|
|
293
332
|
referrer: 'https://www.somereferrer.com',
|
|
@@ -324,7 +363,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
324
363
|
|
|
325
364
|
describe('getUserSyncs', function () {
|
|
326
365
|
it('should have valid user sync with iframeEnabled', function () {
|
|
327
|
-
const result = adapter.getUserSyncs({
|
|
366
|
+
const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
|
|
328
367
|
|
|
329
368
|
expect(result).to.deep.equal([{
|
|
330
369
|
type: 'iframe',
|
|
@@ -333,7 +372,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
333
372
|
});
|
|
334
373
|
|
|
335
374
|
it('should have valid user sync with cid on response', function () {
|
|
336
|
-
const result = adapter.getUserSyncs({
|
|
375
|
+
const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
|
|
337
376
|
expect(result).to.deep.equal([{
|
|
338
377
|
type: 'iframe',
|
|
339
378
|
url: 'https://sync.cootlogix.com/api/sync/iframe/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy='
|
|
@@ -341,7 +380,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
341
380
|
});
|
|
342
381
|
|
|
343
382
|
it('should have valid user sync with pixelEnabled', function () {
|
|
344
|
-
const result = adapter.getUserSyncs({
|
|
383
|
+
const result = adapter.getUserSyncs({pixelEnabled: true}, [SERVER_RESPONSE]);
|
|
345
384
|
|
|
346
385
|
expect(result).to.deep.equal([{
|
|
347
386
|
'url': 'https://sync.cootlogix.com/api/sync/image/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy=',
|
|
@@ -357,12 +396,12 @@ describe('VidazooBidAdapter', function () {
|
|
|
357
396
|
});
|
|
358
397
|
|
|
359
398
|
it('should return empty array when there is no ad', function () {
|
|
360
|
-
const responses = adapter.interpretResponse({
|
|
399
|
+
const responses = adapter.interpretResponse({price: 1, ad: ''});
|
|
361
400
|
expect(responses).to.be.empty;
|
|
362
401
|
});
|
|
363
402
|
|
|
364
403
|
it('should return empty array when there is no price', function () {
|
|
365
|
-
const responses = adapter.interpretResponse({
|
|
404
|
+
const responses = adapter.interpretResponse({price: null, ad: 'great ad'});
|
|
366
405
|
expect(responses).to.be.empty;
|
|
367
406
|
});
|
|
368
407
|
|
|
@@ -422,11 +461,11 @@ describe('VidazooBidAdapter', function () {
|
|
|
422
461
|
const userId = (function () {
|
|
423
462
|
switch (idSystemProvider) {
|
|
424
463
|
case 'lipb':
|
|
425
|
-
return {
|
|
464
|
+
return {lipbid: id};
|
|
426
465
|
case 'parrableId':
|
|
427
|
-
return {
|
|
466
|
+
return {eid: id};
|
|
428
467
|
case 'id5id':
|
|
429
|
-
return {
|
|
468
|
+
return {uid: id};
|
|
430
469
|
default:
|
|
431
470
|
return id;
|
|
432
471
|
}
|
|
@@ -445,18 +484,18 @@ describe('VidazooBidAdapter', function () {
|
|
|
445
484
|
|
|
446
485
|
describe('alternate param names extractors', function () {
|
|
447
486
|
it('should return undefined when param not supported', function () {
|
|
448
|
-
const cid = extractCID({
|
|
449
|
-
const pid = extractPID({
|
|
450
|
-
const subDomain = extractSubDomain({
|
|
487
|
+
const cid = extractCID({'c_id': '1'});
|
|
488
|
+
const pid = extractPID({'p_id': '1'});
|
|
489
|
+
const subDomain = extractSubDomain({'sub_domain': 'prebid'});
|
|
451
490
|
expect(cid).to.be.undefined;
|
|
452
491
|
expect(pid).to.be.undefined;
|
|
453
492
|
expect(subDomain).to.be.undefined;
|
|
454
493
|
});
|
|
455
494
|
|
|
456
495
|
it('should return value when param supported', function () {
|
|
457
|
-
const cid = extractCID({
|
|
458
|
-
const pid = extractPID({
|
|
459
|
-
const subDomain = extractSubDomain({
|
|
496
|
+
const cid = extractCID({'cID': '1'});
|
|
497
|
+
const pid = extractPID({'Pid': '2'});
|
|
498
|
+
const subDomain = extractSubDomain({'subDOMAIN': 'prebid'});
|
|
460
499
|
expect(cid).to.be.equal('1');
|
|
461
500
|
expect(pid).to.be.equal('2');
|
|
462
501
|
expect(subDomain).to.be.equal('prebid');
|
|
@@ -569,7 +608,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
569
608
|
now
|
|
570
609
|
});
|
|
571
610
|
setStorageItem('myKey', 2020);
|
|
572
|
-
const {
|
|
611
|
+
const {value, created} = getStorageItem('myKey');
|
|
573
612
|
expect(created).to.be.equal(now);
|
|
574
613
|
expect(value).to.be.equal(2020);
|
|
575
614
|
expect(typeof value).to.be.equal('number');
|
|
@@ -585,8 +624,8 @@ describe('VidazooBidAdapter', function () {
|
|
|
585
624
|
});
|
|
586
625
|
|
|
587
626
|
it('should parse JSON value', function () {
|
|
588
|
-
const data = JSON.stringify({
|
|
589
|
-
const {
|
|
627
|
+
const data = JSON.stringify({event: 'send'});
|
|
628
|
+
const {event} = tryParseJSON(data);
|
|
590
629
|
expect(event).to.be.equal('send');
|
|
591
630
|
});
|
|
592
631
|
|
|
@@ -41,6 +41,7 @@ describe('Zeta Ssp Bid Adapter', function () {
|
|
|
41
41
|
app: {
|
|
42
42
|
bundle: 'testBundle'
|
|
43
43
|
},
|
|
44
|
+
bidfloor: 0.2,
|
|
44
45
|
test: 1
|
|
45
46
|
};
|
|
46
47
|
|
|
@@ -359,4 +360,11 @@ describe('Zeta Ssp Bid Adapter', function () {
|
|
|
359
360
|
|
|
360
361
|
expect(payload.tmax).to.be.undefined;
|
|
361
362
|
});
|
|
363
|
+
|
|
364
|
+
it('Test provide bidfloor', function () {
|
|
365
|
+
const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
|
|
366
|
+
const payload = JSON.parse(request.data);
|
|
367
|
+
|
|
368
|
+
expect(payload.imp[0].bidfloor).to.eql(params.bidfloor);
|
|
369
|
+
});
|
|
362
370
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {onlyOneClientSection} from '../../../libraries/ortbConverter/processors/default.js';
|
|
2
|
+
|
|
3
|
+
describe('onlyOneClientSection', () => {
|
|
4
|
+
[
|
|
5
|
+
[['app'], 'app'],
|
|
6
|
+
[['site'], 'site'],
|
|
7
|
+
[['dooh'], 'dooh'],
|
|
8
|
+
[['app', 'site'], 'app'],
|
|
9
|
+
[['dooh', 'app', 'site'], 'dooh'],
|
|
10
|
+
[['dooh', 'site'], 'dooh']
|
|
11
|
+
].forEach(([sections, winner]) => {
|
|
12
|
+
it(`should leave only ${winner} in request when it contains ${sections.join(', ')}`, () => {
|
|
13
|
+
const req = Object.fromEntries(sections.map(s => [s, {foo: 'bar'}]));
|
|
14
|
+
onlyOneClientSection(req);
|
|
15
|
+
expect(Object.keys(req)).to.eql([winner]);
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
it('should not choke if none of the sections are in the request', () => {
|
|
19
|
+
const req = {};
|
|
20
|
+
onlyOneClientSection(req);
|
|
21
|
+
expect(req).to.eql({});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -3017,6 +3017,20 @@ describe('Unit: Prebid Module', function () {
|
|
|
3017
3017
|
});
|
|
3018
3018
|
});
|
|
3019
3019
|
|
|
3020
|
+
describe('aliasRegistry', function () {
|
|
3021
|
+
it('should return the same value as adapterManager.aliasRegistry by default', function () {
|
|
3022
|
+
const adapterManagerAliasRegistry = adapterManager.aliasRegistry;
|
|
3023
|
+
const pbjsAliasRegistry = $$PREBID_GLOBAL$$.aliasRegistry;
|
|
3024
|
+
assert.equal(adapterManagerAliasRegistry, pbjsAliasRegistry);
|
|
3025
|
+
});
|
|
3026
|
+
|
|
3027
|
+
it('should return undefined if the aliasRegistry config option is set to private', function () {
|
|
3028
|
+
configObj.setConfig({ aliasRegistry: 'private' });
|
|
3029
|
+
const pbjsAliasRegistry = $$PREBID_GLOBAL$$.aliasRegistry;
|
|
3030
|
+
assert.equal(pbjsAliasRegistry, undefined);
|
|
3031
|
+
});
|
|
3032
|
+
});
|
|
3033
|
+
|
|
3020
3034
|
describe('setPriceGranularity', function () {
|
|
3021
3035
|
it('should log error when not passed granularity', function () {
|
|
3022
3036
|
const logErrorSpy = sinon.spy(utils, 'logError');
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {adjustCpm} from '../../../../src/utils/cpm.js';
|
|
2
|
+
|
|
3
|
+
describe('adjustCpm', () => {
|
|
4
|
+
const bidderCode = 'mockBidder';
|
|
5
|
+
let adjustmentFn, bs, index;
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
bs = {
|
|
8
|
+
get: sinon.stub()
|
|
9
|
+
}
|
|
10
|
+
index = {
|
|
11
|
+
getBidRequest: sinon.stub()
|
|
12
|
+
}
|
|
13
|
+
adjustmentFn = sinon.stub().callsFake((cpm) => cpm * 2);
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('throws when neither bidRequest nor bidResponse are provided', () => {
|
|
17
|
+
expect(() => adjustCpm(1)).to.throw();
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('always provides an object as bidResponse for the adjustment fn', () => {
|
|
21
|
+
bs.get.callsFake(() => adjustmentFn);
|
|
22
|
+
adjustCpm(1, null, {bidder: bidderCode}, {index, bs});
|
|
23
|
+
sinon.assert.calledWith(adjustmentFn, 1, {});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('when no bidRequest is provided', () => {
|
|
27
|
+
Object.entries({
|
|
28
|
+
'unavailable': undefined,
|
|
29
|
+
'found': {foo: 'bar'}
|
|
30
|
+
}).forEach(([t, req]) => {
|
|
31
|
+
describe(`and it is ${t} in the index`, () => {
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
bs.get.callsFake(() => adjustmentFn);
|
|
34
|
+
index.getBidRequest.callsFake(() => req)
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('provides it to the adjustment fn', () => {
|
|
38
|
+
const bidResponse = {bidderCode};
|
|
39
|
+
adjustCpm(1, bidResponse, undefined, {index, bs});
|
|
40
|
+
sinon.assert.calledWith(index.getBidRequest, bidResponse);
|
|
41
|
+
sinon.assert.calledWith(adjustmentFn, 1, bidResponse, req);
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
Object.entries({
|
|
48
|
+
'bidResponse': [{bidderCode}],
|
|
49
|
+
'bidRequest': [null, {bidder: bidderCode}],
|
|
50
|
+
}).forEach(([t, [bidResp, bidReq]]) => {
|
|
51
|
+
describe(`when passed ${t}`, () => {
|
|
52
|
+
beforeEach(() => {
|
|
53
|
+
bs.get.callsFake((bidder) => { if (bidder === bidderCode) return adjustmentFn });
|
|
54
|
+
});
|
|
55
|
+
it('retrieves the correct bidder code', () => {
|
|
56
|
+
expect(adjustCpm(1, bidResp, bidReq, {bs, index})).to.eql(2);
|
|
57
|
+
});
|
|
58
|
+
it('passes them to the adjustment fn', () => {
|
|
59
|
+
adjustCpm(1, bidResp, bidReq, {bs, index});
|
|
60
|
+
sinon.assert.calledWith(adjustmentFn, 1, bidResp == null ? sinon.match.any : bidResp, bidReq);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
})
|
|
64
|
+
});
|