prebid.js 6.0.0 → 6.4.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/.babelrc.js +1 -7
- package/.circleci/config.yml +1 -1
- package/README.md +1 -1
- package/browsers.json +13 -29
- package/gulpfile.js +88 -82
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/karma.conf.maker.js +2 -2
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +147 -61
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/adlooxAdServerVideo.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +4 -4
- package/modules/admanBidAdapter.js +1 -0
- package/modules/admixerBidAdapter.js +3 -2
- package/modules/adnuntiusBidAdapter.js +5 -2
- package/modules/adomikAnalyticsAdapter.js +16 -4
- package/modules/adplusBidAdapter.js +203 -0
- package/modules/adplusBidAdapter.md +39 -0
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/adxcgBidAdapter.md +22 -21
- package/modules/adyoulikeBidAdapter.js +7 -2
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +23 -3
- package/modules/beachfrontBidAdapter.js +14 -17
- package/modules/beopBidAdapter.js +6 -4
- package/modules/bidViewability.js +3 -3
- package/modules/bidViewabilityIO.js +3 -3
- package/modules/codefuelBidAdapter.js +1 -3
- package/modules/codefuelBidAdapter.md +3 -3
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/compassBidAdapter.js +201 -0
- package/modules/compassBidAdapter.md +79 -0
- package/modules/craftBidAdapter.js +5 -3
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/currency.js +2 -2
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/dailyhuntBidAdapter.js +435 -0
- package/modules/dailyhuntBidAdapter.md +4 -0
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/dchain.js +149 -0
- package/modules/dchain.md +45 -0
- package/modules/deepintentBidAdapter.js +1 -1
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/emx_digitalBidAdapter.js +9 -1
- package/modules/engageyaBidAdapter.js +68 -54
- package/modules/feedadBidAdapter.js +2 -2
- package/modules/feedadBidAdapter.md +4 -2
- package/modules/freewheel-sspBidAdapter.js +6 -0
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +44 -16
- package/modules/goldbachBidAdapter.js +1176 -0
- package/modules/goldbachBidAdapter.md +151 -0
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +5 -4
- package/modules/gumgumBidAdapter.js +7 -3
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/improvedigitalBidAdapter.js +19 -3
- package/modules/instreamTracking.js +4 -4
- package/modules/intersectionRtdProvider.js +114 -0
- package/modules/invibesBidAdapter.js +64 -14
- package/modules/invibesBidAdapter.md +2 -1
- package/modules/ipromBidAdapter.js +79 -0
- package/modules/ixBidAdapter.js +185 -22
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedBidAdapter.js +8 -2
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/luponmediaBidAdapter.js +570 -0
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/merkleIdSystem.js +5 -0
- package/modules/missenaBidAdapter.js +89 -0
- package/modules/nativoBidAdapter.js +27 -1
- package/modules/nextMillenniumBidAdapter.js +37 -7
- package/modules/oguryBidAdapter.js +2 -1
- package/modules/openxBidAdapter.js +6 -1
- package/modules/prebidServerBidAdapter/index.js +19 -15
- package/modules/pubgeniusBidAdapter.js +1 -1
- package/modules/pubmaticBidAdapter.js +5 -3
- package/modules/pubxaiAnalyticsAdapter.js +17 -0
- package/modules/relaidoBidAdapter.js +86 -65
- package/modules/richaudienceBidAdapter.js +2 -3
- package/modules/rtdModule/index.js +48 -18
- package/modules/rubiconBidAdapter.js +31 -19
- package/modules/saambaaBidAdapter.js +420 -0
- package/modules/saambaaBidAdapter.md +65 -68
- package/modules/seedtagBidAdapter.js +6 -0
- package/modules/sharedIdSystem.js +27 -1
- package/modules/smaatoBidAdapter.js +9 -1
- package/modules/smartxBidAdapter.js +17 -1
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/tappxBidAdapter.js +3 -1
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/telariaBidAdapter.js +2 -2
- package/modules/trustxBidAdapter.js +18 -17
- package/modules/undertoneBidAdapter.js +8 -1
- package/modules/userId/index.js +27 -2
- package/modules/ventes.md +71 -0
- package/modules/ventesBidAdapter.js +104 -64
- package/modules/ventesBidAdapter.md +0 -1
- package/modules/vidoomyBidAdapter.js +65 -108
- package/modules/visxBidAdapter.js +20 -3
- package/modules/visxBidAdapter.md +4 -6
- package/modules/weboramaRtdProvider.js +288 -73
- package/modules/weboramaRtdProvider.md +27 -10
- package/modules/yahoosspBidAdapter.js +5 -1
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldoneBidAdapter.js +115 -11
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +6 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/adapterManager.js +14 -8
- package/src/auction.js +5 -4
- package/src/prebid.js +1 -2
- package/src/targeting.js +24 -3
- package/src/utils.js +41 -7
- package/test/helpers/prebidGlobal.js +1 -0
- package/test/spec/integration/faker/googletag.js +6 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +35 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
- package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +63 -1
- package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
- package/test/spec/modules/beopBidAdapter_spec.js +1 -1
- package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
- package/test/spec/modules/bidViewability_spec.js +4 -4
- package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/compassBidAdapter_spec.js +397 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/dchain_spec.js +329 -0
- package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +3 -1
- package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
- package/test/spec/modules/invibesBidAdapter_spec.js +148 -4
- package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
- package/test/spec/modules/ixBidAdapter_spec.js +293 -2
- package/test/spec/modules/konduitWrapper_spec.js +0 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
- package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
- package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
- package/test/spec/modules/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
- package/test/spec/modules/openxBidAdapter_spec.js +5 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +62 -2
- package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
- package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
- package/test/spec/modules/realTimeDataModule_spec.js +135 -49
- package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
- package/test/spec/modules/richaudienceBidAdapter_spec.js +2 -2
- package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
- package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
- package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +42 -0
- package/test/spec/modules/userId_spec.js +51 -0
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +121 -5
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/adapterManager_spec.js +24 -6
- package/test/spec/unit/core/targeting_spec.js +116 -0
- package/test/spec/utils_spec.js +38 -0
- package/test/test_deps.js +3 -0
- package/test/test_index.js +1 -3
|
@@ -4,6 +4,7 @@ import { spec } from 'modules/nextMillenniumBidAdapter.js';
|
|
|
4
4
|
describe('nextMillenniumBidAdapterTests', function() {
|
|
5
5
|
const bidRequestData = [
|
|
6
6
|
{
|
|
7
|
+
adUnitCode: 'test-div',
|
|
7
8
|
bidId: 'bid1234',
|
|
8
9
|
auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
|
|
9
10
|
bidder: 'nextMillennium',
|
|
@@ -17,19 +18,43 @@ describe('nextMillenniumBidAdapterTests', function() {
|
|
|
17
18
|
}
|
|
18
19
|
];
|
|
19
20
|
|
|
20
|
-
it('Request params check with GDPR Consent', function () {
|
|
21
|
+
it('Request params check with GDPR and USP Consent', function () {
|
|
21
22
|
const request = spec.buildRequests(bidRequestData, bidRequestData[0]);
|
|
22
23
|
expect(JSON.parse(request[0].data).user.ext.consent).to.equal('kjfdniwjnifwenrif3');
|
|
23
24
|
expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('1---');
|
|
24
25
|
expect(JSON.parse(request[0].data).regs.ext.gdpr).to.equal(1);
|
|
25
26
|
});
|
|
26
27
|
|
|
28
|
+
it('Request params check without GDPR Consent', function () {
|
|
29
|
+
delete bidRequestData[0].gdprConsent
|
|
30
|
+
const request = spec.buildRequests(bidRequestData, bidRequestData[0]);
|
|
31
|
+
expect(JSON.parse(request[0].data).regs.ext.gdpr).to.be.undefined;
|
|
32
|
+
expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('1---');
|
|
33
|
+
});
|
|
34
|
+
|
|
27
35
|
it('validate_generated_params', function() {
|
|
28
36
|
const request = spec.buildRequests(bidRequestData);
|
|
29
37
|
expect(request[0].bidId).to.equal('bid1234');
|
|
30
38
|
expect(JSON.parse(request[0].data).id).to.equal('b06c5141-fe8f-4cdf-9d7d-54415490a917');
|
|
31
39
|
});
|
|
32
40
|
|
|
41
|
+
it('Check if refresh_count param is incremented', function() {
|
|
42
|
+
const request = spec.buildRequests(bidRequestData);
|
|
43
|
+
expect(JSON.parse(request[0].data).refresh_count).to.equal(3);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('Test getUserSyncs function', function () {
|
|
47
|
+
const syncOptions = {
|
|
48
|
+
'iframeEnabled': true
|
|
49
|
+
}
|
|
50
|
+
const userSync = spec.getUserSyncs(syncOptions);
|
|
51
|
+
expect(userSync).to.be.an('array').with.lengthOf(1);
|
|
52
|
+
expect(userSync[0].type).to.exist;
|
|
53
|
+
expect(userSync[0].url).to.exist;
|
|
54
|
+
expect(userSync[0].type).to.be.equal('iframe');
|
|
55
|
+
expect(userSync[0].url).to.be.equal('https://statics.nextmillmedia.com/load-cookie.html?v=4');
|
|
56
|
+
});
|
|
57
|
+
|
|
33
58
|
it('validate_response_params', function() {
|
|
34
59
|
const serverResponse = {
|
|
35
60
|
body: {
|
|
@@ -119,7 +119,7 @@ describe('OguryBidAdapter', function () {
|
|
|
119
119
|
};
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
-
it('should return
|
|
122
|
+
it('should return syncs array with two elements of type image', () => {
|
|
123
123
|
const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent);
|
|
124
124
|
|
|
125
125
|
expect(userSyncs).to.have.lengthOf(2);
|
|
@@ -129,7 +129,7 @@ describe('OguryBidAdapter', function () {
|
|
|
129
129
|
expect(userSyncs[1].url).to.contain('https://ms-cookie-sync.presage.io/ttd/init-sync');
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
-
it('should set the
|
|
132
|
+
it('should set the source as query param', () => {
|
|
133
133
|
const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent);
|
|
134
134
|
expect(userSyncs[0].url).to.contain('source=prebid');
|
|
135
135
|
expect(userSyncs[1].url).to.contain('source=prebid');
|
|
@@ -146,7 +146,7 @@ describe('OguryBidAdapter', function () {
|
|
|
146
146
|
expect(spec.getUserSyncs(syncOptions, [], gdprConsent)).to.have.lengthOf(0);
|
|
147
147
|
});
|
|
148
148
|
|
|
149
|
-
it('should return
|
|
149
|
+
it('should return syncs array with two elements of type image when consentString is undefined', () => {
|
|
150
150
|
gdprConsent = {
|
|
151
151
|
gdprApplies: true,
|
|
152
152
|
consentString: undefined
|
|
@@ -160,7 +160,7 @@ describe('OguryBidAdapter', function () {
|
|
|
160
160
|
expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
-
it('should return
|
|
163
|
+
it('should return syncs array with two elements of type image when consentString is null', () => {
|
|
164
164
|
gdprConsent = {
|
|
165
165
|
gdprApplies: true,
|
|
166
166
|
consentString: null
|
|
@@ -174,7 +174,7 @@ describe('OguryBidAdapter', function () {
|
|
|
174
174
|
expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
-
it('should return
|
|
177
|
+
it('should return syncs array with two elements of type image when gdprConsent is undefined', () => {
|
|
178
178
|
gdprConsent = undefined;
|
|
179
179
|
|
|
180
180
|
const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent);
|
|
@@ -185,7 +185,7 @@ describe('OguryBidAdapter', function () {
|
|
|
185
185
|
expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
it('should return
|
|
188
|
+
it('should return syncs array with two elements of type image when gdprConsent is null', () => {
|
|
189
189
|
gdprConsent = null;
|
|
190
190
|
|
|
191
191
|
const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent);
|
|
@@ -196,7 +196,7 @@ describe('OguryBidAdapter', function () {
|
|
|
196
196
|
expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
|
|
197
197
|
});
|
|
198
198
|
|
|
199
|
-
it('should return
|
|
199
|
+
it('should return syncs array with two elements of type image when gdprConsent is null and gdprApplies is false', () => {
|
|
200
200
|
gdprConsent = {
|
|
201
201
|
gdprApplies: false,
|
|
202
202
|
consentString: null
|
|
@@ -210,7 +210,7 @@ describe('OguryBidAdapter', function () {
|
|
|
210
210
|
expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid')
|
|
211
211
|
});
|
|
212
212
|
|
|
213
|
-
it('should return
|
|
213
|
+
it('should return syncs array with two elements of type image when gdprConsent is empty string and gdprApplies is false', () => {
|
|
214
214
|
gdprConsent = {
|
|
215
215
|
gdprApplies: false,
|
|
216
216
|
consentString: ''
|
|
@@ -240,7 +240,8 @@ describe('OguryBidAdapter', function () {
|
|
|
240
240
|
w: 300,
|
|
241
241
|
h: 250
|
|
242
242
|
}]
|
|
243
|
-
}
|
|
243
|
+
},
|
|
244
|
+
ext: bidRequests[0].params
|
|
244
245
|
}, {
|
|
245
246
|
id: bidRequests[1].bidId,
|
|
246
247
|
tagid: bidRequests[1].params.adUnitId,
|
|
@@ -250,7 +251,8 @@ describe('OguryBidAdapter', function () {
|
|
|
250
251
|
w: 600,
|
|
251
252
|
h: 500
|
|
252
253
|
}]
|
|
253
|
-
}
|
|
254
|
+
},
|
|
255
|
+
ext: bidRequests[1].params
|
|
254
256
|
}],
|
|
255
257
|
regs: {
|
|
256
258
|
ext: {
|
|
@@ -549,7 +551,7 @@ describe('OguryBidAdapter', function () {
|
|
|
549
551
|
xhr.restore()
|
|
550
552
|
})
|
|
551
553
|
|
|
552
|
-
it('should send
|
|
554
|
+
it('should send on bid timeout notification', function() {
|
|
553
555
|
const bid = {
|
|
554
556
|
ad: '<img style="width: 300px; height: 250px;" src="https://assets.afcdn.com/recipe/20190529/93153_w1024h768c1cx2220cy1728cxt0cyt0cxb4441cyb3456.jpg" alt="cookies" />',
|
|
555
557
|
cpm: 3
|
|
@@ -1102,6 +1102,11 @@ describe('OpenxAdapter', function () {
|
|
|
1102
1102
|
mwOpenLinkId: '1111-mwopenlinkid',
|
|
1103
1103
|
dapId: '1111-dapId',
|
|
1104
1104
|
amxId: '1111-amxid',
|
|
1105
|
+
kpuid: '1111-kpuid',
|
|
1106
|
+
publinkId: '1111-publinkid',
|
|
1107
|
+
naveggId: '1111-naveggid',
|
|
1108
|
+
imuid: '1111-imuid',
|
|
1109
|
+
adtelligentId: '1111-adtelligentid'
|
|
1105
1110
|
};
|
|
1106
1111
|
|
|
1107
1112
|
// generates the same set of tests for each id provider
|
|
@@ -8,6 +8,7 @@ import events from 'src/events.js';
|
|
|
8
8
|
import CONSTANTS from 'src/constants.json';
|
|
9
9
|
import { server } from 'test/mocks/xhr.js';
|
|
10
10
|
import { createEidsArray } from 'modules/userId/eids.js';
|
|
11
|
+
import {deepAccess, deepClone} from 'src/utils.js';
|
|
11
12
|
|
|
12
13
|
let CONFIG = {
|
|
13
14
|
accountId: '1',
|
|
@@ -507,6 +508,17 @@ describe('S2S Adapter', function () {
|
|
|
507
508
|
resetSyncedStatus();
|
|
508
509
|
});
|
|
509
510
|
|
|
511
|
+
it('should set id to auction ID and source.tid to tid', function () {
|
|
512
|
+
config.setConfig({ s2sConfig: CONFIG });
|
|
513
|
+
|
|
514
|
+
adapter.callBids(OUTSTREAM_VIDEO_REQUEST, BID_REQUESTS, addBidResponse, done, ajax);
|
|
515
|
+
|
|
516
|
+
const requestBid = JSON.parse(server.requests[0].requestBody);
|
|
517
|
+
expect(requestBid.id).to.equal('173afb6d132ba3');
|
|
518
|
+
expect(requestBid.source).to.be.an('object');
|
|
519
|
+
expect(requestBid.source.tid).to.equal('437fbbf5-33f5-487a-8e16-a7112903cfe5');
|
|
520
|
+
});
|
|
521
|
+
|
|
510
522
|
it('should block request if config did not define p1Consent URL in endpoint object config', function() {
|
|
511
523
|
let badConfig = utils.deepClone(CONFIG);
|
|
512
524
|
badConfig.endpoint = { noP1Consent: 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction' };
|
|
@@ -1081,6 +1093,18 @@ describe('S2S Adapter', function () {
|
|
|
1081
1093
|
});
|
|
1082
1094
|
});
|
|
1083
1095
|
|
|
1096
|
+
it('should not include ext.aspectratios if adunit\'s aspect_ratios do not define radio_width and ratio_height', () => {
|
|
1097
|
+
const req = deepClone(REQUEST);
|
|
1098
|
+
req.ad_units[0].mediaTypes.native.icon.aspect_ratios[0] = {'min_width': 1, 'min_height': 2};
|
|
1099
|
+
adapter.callBids(req, BID_REQUESTS, addBidResponse, done, ajax);
|
|
1100
|
+
const nativeReq = JSON.parse(JSON.parse(server.requests[0].requestBody).imp[0].native.request);
|
|
1101
|
+
const icons = nativeReq.assets.map((a) => a.img).filter((img) => img && img.type === 1);
|
|
1102
|
+
expect(icons).to.have.length(1);
|
|
1103
|
+
expect(icons[0].hmin).to.equal(2);
|
|
1104
|
+
expect(icons[0].wmin).to.equal(1);
|
|
1105
|
+
expect(deepAccess(icons[0], 'ext.aspectratios')).to.be.undefined;
|
|
1106
|
+
})
|
|
1107
|
+
|
|
1084
1108
|
it('adds site if app is not present', function () {
|
|
1085
1109
|
const _config = {
|
|
1086
1110
|
s2sConfig: CONFIG,
|
|
@@ -1705,7 +1729,7 @@ describe('S2S Adapter', function () {
|
|
|
1705
1729
|
expect(parsedRequestBody.ext.prebid.channel).to.deep.equal({name: 'pbjs', version: 'v$prebid.version$'});
|
|
1706
1730
|
});
|
|
1707
1731
|
|
|
1708
|
-
it('
|
|
1732
|
+
it('extPrebid is now mergedDeep -> should include default channel as well', () => {
|
|
1709
1733
|
const s2sBidRequest = utils.deepClone(REQUEST);
|
|
1710
1734
|
const bidRequests = utils.deepClone(BID_REQUESTS);
|
|
1711
1735
|
|
|
@@ -1714,7 +1738,13 @@ describe('S2S Adapter', function () {
|
|
|
1714
1738
|
adapter.callBids(s2sBidRequest, bidRequests, addBidResponse, done, ajax);
|
|
1715
1739
|
|
|
1716
1740
|
const parsedRequestBody = JSON.parse(server.requests[0].requestBody);
|
|
1717
|
-
|
|
1741
|
+
|
|
1742
|
+
// extPrebid is now deep merged with
|
|
1743
|
+
expect(parsedRequestBody.ext.prebid.channel).to.deep.equal({
|
|
1744
|
+
name: 'pbjs',
|
|
1745
|
+
test: 1,
|
|
1746
|
+
version: 'v$prebid.version$'
|
|
1747
|
+
});
|
|
1718
1748
|
});
|
|
1719
1749
|
|
|
1720
1750
|
it('passes first party data in request', () => {
|
|
@@ -2403,6 +2433,36 @@ describe('S2S Adapter', function () {
|
|
|
2403
2433
|
|
|
2404
2434
|
utils.getBidRequest.restore();
|
|
2405
2435
|
});
|
|
2436
|
+
|
|
2437
|
+
describe('on sync requested with no cookie', () => {
|
|
2438
|
+
let cfg, req, csRes;
|
|
2439
|
+
|
|
2440
|
+
beforeEach(() => {
|
|
2441
|
+
cfg = utils.deepClone(CONFIG);
|
|
2442
|
+
req = utils.deepClone(REQUEST);
|
|
2443
|
+
cfg.syncEndpoint = { p1Consent: 'https://prebid.adnxs.com/pbs/v1/cookie_sync' };
|
|
2444
|
+
req.s2sConfig = cfg;
|
|
2445
|
+
config.setConfig({ s2sConfig: cfg });
|
|
2446
|
+
csRes = utils.deepClone(RESPONSE_NO_COOKIE);
|
|
2447
|
+
});
|
|
2448
|
+
|
|
2449
|
+
afterEach(() => {
|
|
2450
|
+
resetSyncedStatus();
|
|
2451
|
+
})
|
|
2452
|
+
|
|
2453
|
+
Object.entries({
|
|
2454
|
+
iframe: () => utils.insertUserSyncIframe,
|
|
2455
|
+
image: () => utils.triggerPixel,
|
|
2456
|
+
}).forEach(([type, syncer]) => {
|
|
2457
|
+
it(`passes timeout to ${type} syncs`, () => {
|
|
2458
|
+
cfg.syncTimeout = 123;
|
|
2459
|
+
csRes.bidder_status[0].usersync.type = type;
|
|
2460
|
+
adapter.callBids(req, BID_REQUESTS, addBidResponse, done, ajax);
|
|
2461
|
+
server.requests[0].respond(200, {}, JSON.stringify(csRes));
|
|
2462
|
+
expect(syncer().args[0]).to.include.members([123]);
|
|
2463
|
+
});
|
|
2464
|
+
});
|
|
2465
|
+
});
|
|
2406
2466
|
});
|
|
2407
2467
|
|
|
2408
2468
|
describe('bid won events', function () {
|
|
@@ -173,7 +173,7 @@ describe('pubGENIUS adapter', () => {
|
|
|
173
173
|
|
|
174
174
|
expectedRequest = {
|
|
175
175
|
method: 'POST',
|
|
176
|
-
url: 'https://
|
|
176
|
+
url: 'https://auction.adpearl.io/prebid/auction',
|
|
177
177
|
data: {
|
|
178
178
|
id: 'fake-auction-id',
|
|
179
179
|
imp: [
|
|
@@ -493,7 +493,7 @@ describe('pubGENIUS adapter', () => {
|
|
|
493
493
|
};
|
|
494
494
|
expectedSync = {
|
|
495
495
|
type: 'iframe',
|
|
496
|
-
url: 'https://
|
|
496
|
+
url: 'https://auction.adpearl.io/usersync/pixels.html?',
|
|
497
497
|
};
|
|
498
498
|
});
|
|
499
499
|
|
|
@@ -551,7 +551,7 @@ describe('pubGENIUS adapter', () => {
|
|
|
551
551
|
onTimeout(timeoutData);
|
|
552
552
|
|
|
553
553
|
expect(server.requests[0].method).to.equal('POST');
|
|
554
|
-
expect(server.requests[0].url).to.equal('https://
|
|
554
|
+
expect(server.requests[0].url).to.equal('https://auction.adpearl.io/prebid/events?type=timeout');
|
|
555
555
|
expect(JSON.parse(server.requests[0].requestBody)).to.deep.equal(timeoutData);
|
|
556
556
|
});
|
|
557
557
|
});
|
|
@@ -28,6 +28,7 @@ describe('pubxai analytics adapter', function() {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
let location = utils.getWindowLocation();
|
|
31
|
+
let storage = window.top['sessionStorage'];
|
|
31
32
|
|
|
32
33
|
let prebidEvent = {
|
|
33
34
|
'auctionInit': {
|
|
@@ -514,6 +515,11 @@ describe('pubxai analytics adapter', function() {
|
|
|
514
515
|
'path': location.pathname,
|
|
515
516
|
'search': location.search
|
|
516
517
|
},
|
|
518
|
+
'pmcDetail': {
|
|
519
|
+
'bidDensity': storage.getItem('pbx:dpbid'),
|
|
520
|
+
'maxBid': storage.getItem('pbx:mxbid'),
|
|
521
|
+
'auctionId': storage.getItem('pbx:aucid')
|
|
522
|
+
}
|
|
517
523
|
};
|
|
518
524
|
|
|
519
525
|
let expectedAfterBid = {
|
|
@@ -577,6 +583,11 @@ describe('pubxai analytics adapter', function() {
|
|
|
577
583
|
'deviceOS': getOS(),
|
|
578
584
|
'browser': getBrowser()
|
|
579
585
|
},
|
|
586
|
+
'pmcDetail': {
|
|
587
|
+
'bidDensity': storage.getItem('pbx:dpbid'),
|
|
588
|
+
'maxBid': storage.getItem('pbx:mxbid'),
|
|
589
|
+
'auctionId': storage.getItem('pbx:aucid')
|
|
590
|
+
},
|
|
580
591
|
'initOptions': initOptions
|
|
581
592
|
};
|
|
582
593
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as rtdModule from 'modules/rtdModule/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import {config} from 'src/config.js';
|
|
3
3
|
import * as sinon from 'sinon';
|
|
4
|
+
import {default as CONSTANTS} from '../../../src/constants.json';
|
|
5
|
+
import {default as events} from '../../../src/events.js';
|
|
4
6
|
|
|
5
7
|
const getBidRequestDataSpy = sinon.spy();
|
|
6
8
|
|
|
@@ -58,33 +60,87 @@ const conf = {
|
|
|
58
60
|
};
|
|
59
61
|
|
|
60
62
|
describe('Real time module', function () {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
rtdModule.attachRealTimeDataProvider(invalidSM);
|
|
64
|
-
rtdModule.attachRealTimeDataProvider(failureSM);
|
|
65
|
-
rtdModule.attachRealTimeDataProvider(nonConfSM);
|
|
66
|
-
rtdModule.attachRealTimeDataProvider(validSMWait);
|
|
67
|
-
});
|
|
63
|
+
let eventHandlers;
|
|
64
|
+
let sandbox;
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
66
|
+
function mockEmitEvent(event, ...args) {
|
|
67
|
+
(eventHandlers[event] || []).forEach((h) => h(...args));
|
|
68
|
+
}
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
before(() => {
|
|
71
|
+
eventHandlers = {};
|
|
72
|
+
sandbox = sinon.sandbox.create();
|
|
73
|
+
sandbox.stub(events, 'on').callsFake((event, handler) => {
|
|
74
|
+
if (!eventHandlers.hasOwnProperty(event)) {
|
|
75
|
+
eventHandlers[event] = [];
|
|
76
|
+
}
|
|
77
|
+
eventHandlers[event].push(handler);
|
|
78
|
+
});
|
|
75
79
|
});
|
|
76
80
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
expect(rtdModule.subModules).to.eql([validSMWait, validSM]);
|
|
81
|
+
after(() => {
|
|
82
|
+
sandbox.restore();
|
|
80
83
|
});
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
describe('', () => {
|
|
86
|
+
const PROVIDERS = [validSM, invalidSM, failureSM, nonConfSM, validSMWait];
|
|
87
|
+
let _detachers;
|
|
88
|
+
|
|
89
|
+
beforeEach(function () {
|
|
90
|
+
_detachers = PROVIDERS.map(rtdModule.attachRealTimeDataProvider);
|
|
91
|
+
rtdModule.init(config);
|
|
92
|
+
config.setConfig(conf);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
afterEach(function () {
|
|
96
|
+
_detachers.forEach((f) => f());
|
|
97
|
+
config.resetConfig();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should use only valid modules', function () {
|
|
101
|
+
expect(rtdModule.subModules).to.eql([validSMWait, validSM]);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should be able to modify bid request', function (done) {
|
|
105
|
+
rtdModule.setBidRequestsData(() => {
|
|
106
|
+
assert(getBidRequestDataSpy.calledTwice);
|
|
107
|
+
assert(getBidRequestDataSpy.calledWith({bidRequest: {}}));
|
|
108
|
+
done();
|
|
109
|
+
}, {bidRequest: {}})
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('sould place targeting on adUnits', function (done) {
|
|
113
|
+
const auction = {
|
|
114
|
+
adUnitCodes: ['ad1', 'ad2'],
|
|
115
|
+
adUnits: [
|
|
116
|
+
{
|
|
117
|
+
code: 'ad1'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
code: 'ad2',
|
|
121
|
+
adserverTargeting: {preKey: 'preValue'}
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const expectedAdUnits = [
|
|
127
|
+
{
|
|
128
|
+
code: 'ad1',
|
|
129
|
+
adserverTargeting: {key: 'validSMWait'}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
code: 'ad2',
|
|
133
|
+
adserverTargeting: {
|
|
134
|
+
preKey: 'preValue',
|
|
135
|
+
key: 'validSM'
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
];
|
|
139
|
+
|
|
140
|
+
const adUnits = rtdModule.getAdUnitTargeting(auction);
|
|
141
|
+
assert.deepEqual(expectedAdUnits, adUnits)
|
|
86
142
|
done();
|
|
87
|
-
}
|
|
143
|
+
})
|
|
88
144
|
});
|
|
89
145
|
|
|
90
146
|
it('deep merge object', function () {
|
|
@@ -125,36 +181,66 @@ describe('Real time module', function () {
|
|
|
125
181
|
assert.deepEqual(expected, merged);
|
|
126
182
|
});
|
|
127
183
|
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
184
|
+
describe('event', () => {
|
|
185
|
+
const EVENTS = {
|
|
186
|
+
[CONSTANTS.EVENTS.AUCTION_INIT]: 'onAuctionInitEvent',
|
|
187
|
+
[CONSTANTS.EVENTS.AUCTION_END]: 'onAuctionEndEvent',
|
|
188
|
+
[CONSTANTS.EVENTS.BID_RESPONSE]: 'onBidResponseEvent',
|
|
189
|
+
[CONSTANTS.EVENTS.BID_REQUESTED]: 'onBidRequestEvent'
|
|
190
|
+
}
|
|
191
|
+
const conf = {
|
|
192
|
+
'realTimeData': {
|
|
193
|
+
dataProviders: [
|
|
194
|
+
{
|
|
195
|
+
'name': 'tp1',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
'name': 'tp2'
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
140
202
|
};
|
|
203
|
+
let providers;
|
|
204
|
+
let _detachers;
|
|
141
205
|
|
|
142
|
-
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
code: 'ad2',
|
|
149
|
-
adserverTargeting: {
|
|
150
|
-
preKey: 'preValue',
|
|
151
|
-
key: 'validSM'
|
|
152
|
-
}
|
|
206
|
+
function eventHandlingProvider(name) {
|
|
207
|
+
const provider = {
|
|
208
|
+
name: name,
|
|
209
|
+
init: () => true
|
|
153
210
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
211
|
+
Object.values(EVENTS).forEach((ev) => provider[ev] = sinon.spy());
|
|
212
|
+
return provider;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
beforeEach(() => {
|
|
216
|
+
providers = [eventHandlingProvider('tp1'), eventHandlingProvider('tp2')];
|
|
217
|
+
_detachers = providers.map(rtdModule.attachRealTimeDataProvider);
|
|
218
|
+
rtdModule.init(config);
|
|
219
|
+
config.setConfig(conf);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
afterEach(() => {
|
|
223
|
+
_detachers.forEach((d) => d())
|
|
224
|
+
config.resetConfig();
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
Object.entries(EVENTS).forEach(([event, hook]) => {
|
|
228
|
+
it(`'${event}' should be propagated to providers through '${hook}'`, () => {
|
|
229
|
+
const eventArg = {};
|
|
230
|
+
mockEmitEvent(event, eventArg);
|
|
231
|
+
providers.forEach((provider) => {
|
|
232
|
+
const providerConf = conf.realTimeData.dataProviders.find((cfg) => cfg.name === provider.name);
|
|
233
|
+
expect(provider[hook].called).to.be.true;
|
|
234
|
+
expect(provider[hook].args).to.have.length(1);
|
|
235
|
+
expect(provider[hook].args[0]).to.include.members([eventArg, providerConf])
|
|
236
|
+
})
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it(`${event} should not fail to propagate elsewhere if a provider throws in its event handler`, () => {
|
|
240
|
+
providers[0][hook] = function () { throw new Error() };
|
|
241
|
+
mockEmitEvent(event);
|
|
242
|
+
expect(providers[1][hook].called).to.be.true;
|
|
243
|
+
});
|
|
244
|
+
});
|
|
159
245
|
})
|
|
160
246
|
});
|