prebid.js 5.18.0 → 6.1.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 -10
- package/README.md +3 -1
- package/browsers.json +1 -8
- package/gulpfile.js +1 -0
- package/integrationExamples/gpt/akamaidap_segments_example.html +132 -0
- package/modules/.submodules.json +1 -0
- package/modules/adfBidAdapter.js +21 -16
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +1 -0
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/adomikAnalyticsAdapter.js +10 -4
- package/modules/adtelligentBidAdapter.js +2 -1
- package/modules/airgridRtdProvider.js +1 -1
- package/modules/akamaiDapRtdProvider.js +474 -0
- package/modules/akamaiDapRtdProvider.md +47 -0
- package/modules/appnexusBidAdapter.js +9 -3
- package/modules/atsAnalyticsAdapter.js +67 -46
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/betweenBidAdapter.js +20 -3
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/codefuelBidAdapter.js +181 -0
- package/modules/codefuelBidAdapter.md +111 -0
- package/modules/connectIdSystem.js +104 -0
- package/modules/connectIdSystem.md +33 -0
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/deepintentBidAdapter.js +107 -10
- package/modules/deepintentBidAdapter.md +36 -1
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/engageyaBidAdapter.js +171 -0
- package/modules/glimpseBidAdapter.js +31 -16
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +1 -0
- package/modules/gumgumBidAdapter.js +8 -0
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/inskinBidAdapter.js +7 -3
- package/modules/ixBidAdapter.js +174 -22
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/limelightDigitalBidAdapter.js +22 -2
- package/modules/livewrappedAnalyticsAdapter.js +49 -1
- package/modules/merkleIdSystem.js +5 -0
- package/modules/multibid/index.js +3 -3
- package/modules/nativoBidAdapter.js +32 -2
- package/modules/nextMillenniumBidAdapter.js +12 -3
- package/modules/oguryBidAdapter.js +16 -2
- package/modules/openxBidAdapter.js +40 -23
- package/modules/operaadsBidAdapter.js +21 -1
- package/modules/otmBidAdapter.js +146 -0
- package/modules/otmBidAdapter.md +27 -26
- package/modules/outbrainBidAdapter.js +5 -0
- package/modules/playwireBidAdapter.md +61 -0
- package/modules/prebidServerBidAdapter/index.js +3 -3
- package/modules/publinkIdSystem.js +11 -6
- package/modules/pubmaticBidAdapter.js +2 -0
- package/modules/rtdModule/index.js +2 -2
- package/modules/saambaaBidAdapter.js +420 -0
- package/modules/saambaaBidAdapter.md +65 -68
- package/modules/seedtagBidAdapter.js +6 -0
- package/modules/smaatoBidAdapter.js +6 -1
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/tripleliftBidAdapter.js +22 -5
- package/modules/trustxBidAdapter.js +18 -7
- package/modules/undertoneBidAdapter.js +9 -5
- package/modules/undertoneBidAdapter.md +5 -1
- package/modules/userId/eids.js +18 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/userId.md +12 -0
- package/modules/ventesBidAdapter.js +370 -0
- package/modules/ventesBidAdapter.md +94 -0
- package/modules/videobyteBidAdapter.js +13 -6
- package/modules/videobyteBidAdapter.md +49 -0
- package/modules/vidoomyBidAdapter.js +51 -100
- package/modules/visxBidAdapter.js +1 -1
- package/modules/yahoosspBidAdapter.js +6 -6
- package/modules/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldmoSyntheticInventoryModule.js +46 -0
- package/modules/yieldmoSyntheticInventoryModule.md +68 -0
- package/package.json +6 -1
- package/src/adapterManager.js +19 -8
- package/src/adapters/bidderFactory.js +4 -3
- package/src/auction.js +11 -11
- package/src/constants.json +1 -0
- package/src/secureCreatives.js +6 -7
- package/src/targeting.js +11 -9
- package/test/spec/modules/adfBidAdapter_spec.js +83 -29
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/akamaiDapRtdProvider_spec.js +246 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +16 -1
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
- package/test/spec/modules/betweenBidAdapter_spec.js +41 -0
- package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
- package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
- package/test/spec/modules/codefuelBidAdapter_spec.js +316 -0
- package/test/spec/modules/connectIdSystem_spec.js +189 -0
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/deepintentBidAdapter_spec.js +153 -3
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +422 -0
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +5 -1
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/ixBidAdapter_spec.js +298 -5
- package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
- package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
- package/test/spec/modules/konduitWrapper_spec.js +0 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +155 -1
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +52 -7
- package/test/spec/modules/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +13 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +66 -23
- package/test/spec/modules/openxBidAdapter_spec.js +90 -13
- package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
- package/test/spec/modules/otmBidAdapter_spec.js +67 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +19 -2
- package/test/spec/modules/publinkIdSystem_spec.js +6 -6
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/smaatoBidAdapter_spec.js +30 -0
- package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
- package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
- package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +128 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +45 -3
- package/test/spec/modules/undertoneBidAdapter_spec.js +52 -0
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/modules/videobyteBidAdapter_spec.js +2 -2
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +1 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js +89 -0
- package/test/spec/unit/core/adapterManager_spec.js +56 -6
- package/test/spec/unit/core/bidderFactory_spec.js +61 -1
- package/test/spec/unit/pbjs_api_spec.js +37 -2
- package/test/spec/unit/secureCreatives_spec.js +54 -25
- package/wdio.conf.js +1 -1
|
@@ -8,29 +8,46 @@ import { spec } from 'modules/nativoBidAdapter.js'
|
|
|
8
8
|
describe('nativoBidAdapterTests', function () {
|
|
9
9
|
describe('isBidRequestValid', function () {
|
|
10
10
|
let bid = {
|
|
11
|
-
bidder: 'nativo'
|
|
12
|
-
params: {
|
|
13
|
-
placementId: '10433394',
|
|
14
|
-
},
|
|
15
|
-
adUnitCode: 'adunit-code',
|
|
16
|
-
sizes: [
|
|
17
|
-
[300, 250],
|
|
18
|
-
[300, 600],
|
|
19
|
-
],
|
|
20
|
-
bidId: '27b02036ccfa6e',
|
|
21
|
-
bidderRequestId: '1372cd8bd8d6a8',
|
|
22
|
-
auctionId: 'cfc467e4-2707-48da-becb-bcaab0b2c114',
|
|
11
|
+
bidder: 'nativo'
|
|
23
12
|
}
|
|
24
13
|
|
|
25
|
-
it('should return true
|
|
14
|
+
it('should return true if no params found', function () {
|
|
15
|
+
expect(spec.isBidRequestValid(bid)).to.equal(true)
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('should return true for valid placementId value', function () {
|
|
19
|
+
bid.params = {
|
|
20
|
+
placementId: '10433394',
|
|
21
|
+
}
|
|
22
|
+
expect(spec.isBidRequestValid(bid)).to.equal(true)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('should return true for valid placementId value', function () {
|
|
26
|
+
bid.params = {
|
|
27
|
+
placementId: 10433394,
|
|
28
|
+
}
|
|
29
|
+
expect(spec.isBidRequestValid(bid)).to.equal(true)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('should return false for invalid placementId value', function () {
|
|
33
|
+
bid.params = {
|
|
34
|
+
placementId: true,
|
|
35
|
+
}
|
|
36
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('should return true for valid placementId value', function () {
|
|
40
|
+
bid.params = {
|
|
41
|
+
url: 'www.test.com',
|
|
42
|
+
}
|
|
26
43
|
expect(spec.isBidRequestValid(bid)).to.equal(true)
|
|
27
44
|
})
|
|
28
45
|
|
|
29
|
-
it('should return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
expect(spec.isBidRequestValid(
|
|
46
|
+
it('should return false for invalid placementId value', function () {
|
|
47
|
+
bid.params = {
|
|
48
|
+
url: 4567890,
|
|
49
|
+
}
|
|
50
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false)
|
|
34
51
|
})
|
|
35
52
|
})
|
|
36
53
|
|
|
@@ -8,10 +8,22 @@ describe('nextMillenniumBidAdapterTests', function() {
|
|
|
8
8
|
auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
|
|
9
9
|
bidder: 'nextMillennium',
|
|
10
10
|
params: { placement_id: '-1' },
|
|
11
|
-
sizes: [[300, 250]]
|
|
11
|
+
sizes: [[300, 250]],
|
|
12
|
+
uspConsent: '1---',
|
|
13
|
+
gdprConsent: {
|
|
14
|
+
consentString: 'kjfdniwjnifwenrif3',
|
|
15
|
+
gdprApplies: true
|
|
16
|
+
}
|
|
12
17
|
}
|
|
13
18
|
];
|
|
14
19
|
|
|
20
|
+
it('Request params check with GDPR Consent', function () {
|
|
21
|
+
const request = spec.buildRequests(bidRequestData, bidRequestData[0]);
|
|
22
|
+
expect(JSON.parse(request[0].data).user.ext.consent).to.equal('kjfdniwjnifwenrif3');
|
|
23
|
+
expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('1---');
|
|
24
|
+
expect(JSON.parse(request[0].data).regs.ext.gdpr).to.equal(1);
|
|
25
|
+
});
|
|
26
|
+
|
|
15
27
|
it('validate_generated_params', function() {
|
|
16
28
|
const request = spec.buildRequests(bidRequestData);
|
|
17
29
|
expect(request[0].bidId).to.equal('bid1234');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { spec } from 'modules/oguryBidAdapter';
|
|
3
|
-
import
|
|
3
|
+
import * as utils from 'src/utils.js';
|
|
4
4
|
|
|
5
5
|
const BID_URL = 'https://mweb-hb.presage.io/api/header-bidding-request';
|
|
6
6
|
const TIMEOUT_URL = 'https://ms-ads-monitoring-events.presage.io/bid_timeout'
|
|
@@ -68,14 +68,14 @@ describe('OguryBidAdapter', function () {
|
|
|
68
68
|
|
|
69
69
|
describe('isBidRequestValid', function () {
|
|
70
70
|
it('should validate correct bid', () => {
|
|
71
|
-
let validBid = deepClone(bidRequests[0]);
|
|
71
|
+
let validBid = utils.deepClone(bidRequests[0]);
|
|
72
72
|
|
|
73
73
|
let isValid = spec.isBidRequestValid(validBid);
|
|
74
74
|
expect(isValid).to.equal(true);
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
it('should not validate incorrect bid', () => {
|
|
78
|
-
let invalidBid = deepClone(bidRequests[0]);
|
|
78
|
+
let invalidBid = utils.deepClone(bidRequests[0]);
|
|
79
79
|
delete invalidBid.sizes;
|
|
80
80
|
delete invalidBid.mediaTypes;
|
|
81
81
|
|
|
@@ -84,7 +84,7 @@ describe('OguryBidAdapter', function () {
|
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
it('should not validate bid if adunit is not present', () => {
|
|
87
|
-
let invalidBid = deepClone(bidRequests[0]);
|
|
87
|
+
let invalidBid = utils.deepClone(bidRequests[0]);
|
|
88
88
|
delete invalidBid.params.adUnitId;
|
|
89
89
|
|
|
90
90
|
let isValid = spec.isBidRequestValid(invalidBid);
|
|
@@ -92,7 +92,7 @@ describe('OguryBidAdapter', function () {
|
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
it('should not validate bid if assetKet is not present', () => {
|
|
95
|
-
let invalidBid = deepClone(bidRequests[0]);
|
|
95
|
+
let invalidBid = utils.deepClone(bidRequests[0]);
|
|
96
96
|
delete invalidBid.params.assetKey;
|
|
97
97
|
|
|
98
98
|
let isValid = spec.isBidRequestValid(invalidBid);
|
|
@@ -100,7 +100,7 @@ describe('OguryBidAdapter', function () {
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
it('should validate bid if getFloor is not present', () => {
|
|
103
|
-
let invalidBid = deepClone(bidRequests[1]);
|
|
103
|
+
let invalidBid = utils.deepClone(bidRequests[1]);
|
|
104
104
|
delete invalidBid.getFloor;
|
|
105
105
|
|
|
106
106
|
let isValid = spec.isBidRequestValid(invalidBid);
|
|
@@ -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: {
|
|
@@ -270,7 +272,7 @@ describe('OguryBidAdapter', function () {
|
|
|
270
272
|
};
|
|
271
273
|
|
|
272
274
|
it('sends bid request to ENDPOINT via POST', function () {
|
|
273
|
-
const validBidRequests = deepClone(bidRequests)
|
|
275
|
+
const validBidRequests = utils.deepClone(bidRequests)
|
|
274
276
|
|
|
275
277
|
const request = spec.buildRequests(validBidRequests, bidderRequest);
|
|
276
278
|
expect(request.url).to.equal(BID_URL);
|
|
@@ -278,7 +280,7 @@ describe('OguryBidAdapter', function () {
|
|
|
278
280
|
});
|
|
279
281
|
|
|
280
282
|
it('bid request object should be conform', function () {
|
|
281
|
-
const validBidRequests = deepClone(bidRequests)
|
|
283
|
+
const validBidRequests = utils.deepClone(bidRequests)
|
|
282
284
|
|
|
283
285
|
const request = spec.buildRequests(validBidRequests, bidderRequest);
|
|
284
286
|
expect(request.data).to.deep.equal(expectedRequestObject);
|
|
@@ -316,7 +318,7 @@ describe('OguryBidAdapter', function () {
|
|
|
316
318
|
...expectedRequestObject
|
|
317
319
|
};
|
|
318
320
|
|
|
319
|
-
const validBidRequests = deepClone(bidRequests);
|
|
321
|
+
const validBidRequests = utils.deepClone(bidRequests);
|
|
320
322
|
validBidRequests[1] = {
|
|
321
323
|
...validBidRequests[1],
|
|
322
324
|
getFloor: undefined
|
|
@@ -331,7 +333,7 @@ describe('OguryBidAdapter', function () {
|
|
|
331
333
|
...expectedRequestObject
|
|
332
334
|
};
|
|
333
335
|
|
|
334
|
-
let validBidRequests = deepClone(bidRequests);
|
|
336
|
+
let validBidRequests = utils.deepClone(bidRequests);
|
|
335
337
|
validBidRequests[1] = {
|
|
336
338
|
...validBidRequests[1],
|
|
337
339
|
getFloor: 'getFloor'
|
|
@@ -342,9 +344,9 @@ describe('OguryBidAdapter', function () {
|
|
|
342
344
|
});
|
|
343
345
|
|
|
344
346
|
it('should handle bidFloor when currency is not USD', () => {
|
|
345
|
-
const expectedRequestWithUnsupportedFloorCurrency = deepClone(expectedRequestObject)
|
|
347
|
+
const expectedRequestWithUnsupportedFloorCurrency = utils.deepClone(expectedRequestObject)
|
|
346
348
|
expectedRequestWithUnsupportedFloorCurrency.imp[0].bidfloor = 0;
|
|
347
|
-
let validBidRequests = deepClone(bidRequests);
|
|
349
|
+
let validBidRequests = utils.deepClone(bidRequests);
|
|
348
350
|
validBidRequests[0] = {
|
|
349
351
|
...validBidRequests[0],
|
|
350
352
|
getFloor: ({ size, currency, mediaType }) => {
|
|
@@ -490,6 +492,47 @@ describe('OguryBidAdapter', function () {
|
|
|
490
492
|
expect(requests[0].url).to.equal(nurl);
|
|
491
493
|
expect(requests[0].method).to.equal('GET')
|
|
492
494
|
})
|
|
495
|
+
|
|
496
|
+
it('Should trigger getWindowContext method', function() {
|
|
497
|
+
const bidSample = {
|
|
498
|
+
id: 'advertId',
|
|
499
|
+
impid: 'bidId',
|
|
500
|
+
price: 100,
|
|
501
|
+
nurl: 'url',
|
|
502
|
+
adm: `<html><head><title>test creative</title></head><body style="margin: 0;"><div><img style="width: 300px; height: 250px;" src="https://assets.afcdn.com/recipe/20190529/93153_w1024h768c1cx2220cy1728cxt0cyt0cxb4441cyb3456.jpg" alt="cookies" /></div></body></html>`,
|
|
503
|
+
adomain: ['renault.fr'],
|
|
504
|
+
ext: {
|
|
505
|
+
adcontent: 'sample_creative',
|
|
506
|
+
advertid: '1a278c48-b79a-4bbf-b69f-3824803e7d87',
|
|
507
|
+
campaignid: '31724',
|
|
508
|
+
mediatype: 'image',
|
|
509
|
+
userid: 'ab4aabed-5230-49d9-9f1a-f06280d28366',
|
|
510
|
+
usersync: true,
|
|
511
|
+
advertiserid: '1',
|
|
512
|
+
isomidcompliant: false
|
|
513
|
+
},
|
|
514
|
+
w: 180,
|
|
515
|
+
h: 101
|
|
516
|
+
}
|
|
517
|
+
spec.onBidWon(bidSample)
|
|
518
|
+
expect(window.top.OG_PREBID_BID_OBJECT).to.deep.equal(bidSample)
|
|
519
|
+
})
|
|
520
|
+
})
|
|
521
|
+
|
|
522
|
+
describe('getWindowContext', function() {
|
|
523
|
+
it('Should return top window if exist', function() {
|
|
524
|
+
const res = spec.getWindowContext()
|
|
525
|
+
expect(res).to.equal(window.top)
|
|
526
|
+
expect(res).to.not.be.undefined;
|
|
527
|
+
})
|
|
528
|
+
|
|
529
|
+
it('Should return self window if getting top window throw an error', function() {
|
|
530
|
+
const stub = sinon.stub(utils, 'getWindowTop')
|
|
531
|
+
stub.throws()
|
|
532
|
+
const res = spec.getWindowContext()
|
|
533
|
+
expect(res).to.equal(window.self)
|
|
534
|
+
utils.getWindowTop.restore()
|
|
535
|
+
})
|
|
493
536
|
})
|
|
494
537
|
|
|
495
538
|
describe('onTimeout', function () {
|
|
@@ -508,7 +551,7 @@ describe('OguryBidAdapter', function () {
|
|
|
508
551
|
xhr.restore()
|
|
509
552
|
})
|
|
510
553
|
|
|
511
|
-
it('should send
|
|
554
|
+
it('should send on bid timeout notification', function() {
|
|
512
555
|
const bid = {
|
|
513
556
|
ad: '<img style="width: 300px; height: 250px;" src="https://assets.afcdn.com/recipe/20190529/93153_w1024h768c1cx2220cy1728cxt0cyt0cxb4441cyb3456.jpg" alt="cookies" />',
|
|
514
557
|
cpm: 3
|
|
@@ -1085,7 +1085,7 @@ describe('OpenxAdapter', function () {
|
|
|
1085
1085
|
intentIqId: '1111-intentiqid',
|
|
1086
1086
|
lipb: {lipbid: '1111-lipb'},
|
|
1087
1087
|
lotamePanoramaId: '1111-lotameid',
|
|
1088
|
-
merkleId: '1111-merkleid',
|
|
1088
|
+
merkleId: {id: '1111-merkleid'},
|
|
1089
1089
|
netId: 'fH5A3n2O8_CZZyPoJVD-eabc6ECb7jhxCicsds7qSg',
|
|
1090
1090
|
parrableId: { eid: 'eidVersion.encryptionKeyReference.encryptedValue' },
|
|
1091
1091
|
pubcid: '1111-pubcid',
|
|
@@ -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
|
|
@@ -1139,6 +1144,9 @@ describe('OpenxAdapter', function () {
|
|
|
1139
1144
|
let userIdValue;
|
|
1140
1145
|
// handle cases where userId key refers to an object
|
|
1141
1146
|
switch (userIdProviderKey) {
|
|
1147
|
+
case 'merkleId':
|
|
1148
|
+
userIdValue = EXAMPLE_DATA_BY_ATTR.merkleId.id;
|
|
1149
|
+
break;
|
|
1142
1150
|
case 'flocId':
|
|
1143
1151
|
userIdValue = EXAMPLE_DATA_BY_ATTR.flocId.id;
|
|
1144
1152
|
break;
|
|
@@ -1545,7 +1553,7 @@ describe('OpenxAdapter', function () {
|
|
|
1545
1553
|
describe('with segments', function () {
|
|
1546
1554
|
const TESTS = [
|
|
1547
1555
|
{
|
|
1548
|
-
name: 'should send proprietary segment data from
|
|
1556
|
+
name: 'should send proprietary segment data from ortb2.user.data',
|
|
1549
1557
|
config: {
|
|
1550
1558
|
ortb2: {
|
|
1551
1559
|
user: {
|
|
@@ -1556,10 +1564,51 @@ describe('OpenxAdapter', function () {
|
|
|
1556
1564
|
}
|
|
1557
1565
|
}
|
|
1558
1566
|
},
|
|
1559
|
-
expect: 'dmp1/4:foo|bar,dmp2:baz',
|
|
1567
|
+
expect: {sm: 'dmp1/4:foo|bar,dmp2:baz'},
|
|
1560
1568
|
},
|
|
1561
1569
|
{
|
|
1562
|
-
name: 'should
|
|
1570
|
+
name: 'should send proprietary segment data from ortb2.site.content.data',
|
|
1571
|
+
config: {
|
|
1572
|
+
ortb2: {
|
|
1573
|
+
site: {
|
|
1574
|
+
content: {
|
|
1575
|
+
data: [
|
|
1576
|
+
{name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
|
|
1577
|
+
{name: 'dmp2', segment: [{id: 'baz'}]},
|
|
1578
|
+
]
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
expect: {scsm: 'dmp1/4:foo|bar,dmp2:baz'},
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
name: 'should send proprietary segment data from both ortb2.site.content.data and ortb2.user.data',
|
|
1587
|
+
config: {
|
|
1588
|
+
ortb2: {
|
|
1589
|
+
user: {
|
|
1590
|
+
data: [
|
|
1591
|
+
{name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
|
|
1592
|
+
{name: 'dmp2', segment: [{id: 'baz'}]},
|
|
1593
|
+
]
|
|
1594
|
+
},
|
|
1595
|
+
site: {
|
|
1596
|
+
content: {
|
|
1597
|
+
data: [
|
|
1598
|
+
{name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]},
|
|
1599
|
+
{name: 'dmp4', segment: [{id: 'baz2'}]},
|
|
1600
|
+
]
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
},
|
|
1605
|
+
expect: {
|
|
1606
|
+
sm: 'dmp1/4:foo|bar,dmp2:baz',
|
|
1607
|
+
scsm: 'dmp3/5:foo2|bar2,dmp4:baz2'
|
|
1608
|
+
},
|
|
1609
|
+
},
|
|
1610
|
+
{
|
|
1611
|
+
name: 'should combine same provider segment data from ortb2.user.data',
|
|
1563
1612
|
config: {
|
|
1564
1613
|
ortb2: {
|
|
1565
1614
|
user: {
|
|
@@ -1570,7 +1619,23 @@ describe('OpenxAdapter', function () {
|
|
|
1570
1619
|
}
|
|
1571
1620
|
}
|
|
1572
1621
|
},
|
|
1573
|
-
expect: 'dmp1/4:foo|bar,dmp1:baz',
|
|
1622
|
+
expect: {sm: 'dmp1/4:foo|bar,dmp1:baz'},
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
name: 'should combine same provider segment data from ortb2.site.content.data',
|
|
1626
|
+
config: {
|
|
1627
|
+
ortb2: {
|
|
1628
|
+
site: {
|
|
1629
|
+
content: {
|
|
1630
|
+
data: [
|
|
1631
|
+
{name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
|
|
1632
|
+
{name: 'dmp1', ext: {}, segment: [{id: 'baz'}]},
|
|
1633
|
+
]
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1638
|
+
expect: {scsm: 'dmp1/4:foo|bar,dmp1:baz'},
|
|
1574
1639
|
},
|
|
1575
1640
|
{
|
|
1576
1641
|
name: 'should not send any segment data if first party config is incomplete',
|
|
@@ -1595,6 +1660,14 @@ describe('OpenxAdapter', function () {
|
|
|
1595
1660
|
{name: 'dmp1', segment: [{id: 'foo'}, {id: 'bar'}]},
|
|
1596
1661
|
{name: 'dmp2', segment: [{id: 'baz'}]},
|
|
1597
1662
|
]
|
|
1663
|
+
},
|
|
1664
|
+
site: {
|
|
1665
|
+
content: {
|
|
1666
|
+
data: [
|
|
1667
|
+
{name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]},
|
|
1668
|
+
{name: 'dmp4', segment: [{id: 'baz2'}]},
|
|
1669
|
+
]
|
|
1670
|
+
}
|
|
1598
1671
|
}
|
|
1599
1672
|
}
|
|
1600
1673
|
},
|
|
@@ -1606,7 +1679,10 @@ describe('OpenxAdapter', function () {
|
|
|
1606
1679
|
},
|
|
1607
1680
|
},
|
|
1608
1681
|
},
|
|
1609
|
-
expect:
|
|
1682
|
+
expect: {
|
|
1683
|
+
sm: 'dmp1:foo|bar,dmp2:baz,liveintent:l1|l2',
|
|
1684
|
+
scsm: 'dmp3/5:foo2|bar2,dmp4:baz2'
|
|
1685
|
+
},
|
|
1610
1686
|
},
|
|
1611
1687
|
{
|
|
1612
1688
|
name: 'should send just liveintent segment from request if no first party config',
|
|
@@ -1619,7 +1695,7 @@ describe('OpenxAdapter', function () {
|
|
|
1619
1695
|
},
|
|
1620
1696
|
},
|
|
1621
1697
|
},
|
|
1622
|
-
expect: 'liveintent:l1|l2',
|
|
1698
|
+
expect: {sm: 'liveintent:l1|l2'},
|
|
1623
1699
|
},
|
|
1624
1700
|
{
|
|
1625
1701
|
name: 'should send nothing if lipb section does not contain segments',
|
|
@@ -1636,13 +1712,11 @@ describe('OpenxAdapter', function () {
|
|
|
1636
1712
|
utils._each(TESTS, (t) => {
|
|
1637
1713
|
context('in ortb2.user.data', function () {
|
|
1638
1714
|
let bidRequests;
|
|
1639
|
-
let configStub;
|
|
1640
|
-
|
|
1641
1715
|
beforeEach(function () {
|
|
1642
1716
|
let fpdConfig = t.config
|
|
1643
|
-
|
|
1717
|
+
sinon
|
|
1644
1718
|
.stub(config, 'getConfig')
|
|
1645
|
-
.withArgs(
|
|
1719
|
+
.withArgs(sinon.match(/^ortb2\.user\.data$|^ortb2\.site\.content\.data$/))
|
|
1646
1720
|
.callsFake((key) => {
|
|
1647
1721
|
return utils.deepAccess(fpdConfig, key);
|
|
1648
1722
|
});
|
|
@@ -1658,10 +1732,13 @@ describe('OpenxAdapter', function () {
|
|
|
1658
1732
|
const request = spec.buildRequests(bidRequests, mockBidderRequest)
|
|
1659
1733
|
expect(request.length).to.equal(1);
|
|
1660
1734
|
if (t.expect) {
|
|
1661
|
-
|
|
1662
|
-
|
|
1735
|
+
for (const key in t.expect) {
|
|
1736
|
+
expect(request[0].data[key]).to.exist;
|
|
1737
|
+
expect(request[0].data[key]).to.equal(t.expect[key]);
|
|
1738
|
+
}
|
|
1663
1739
|
} else {
|
|
1664
1740
|
expect(request[0].data.sm).to.not.exist;
|
|
1741
|
+
expect(request[0].data.scsm).to.not.exist;
|
|
1665
1742
|
}
|
|
1666
1743
|
});
|
|
1667
1744
|
});
|
|
@@ -369,7 +369,7 @@ describe('Opera Ads Bid Adapter', function () {
|
|
|
369
369
|
requestData = JSON.parse(reqs[0].data);
|
|
370
370
|
}).to.not.throw();
|
|
371
371
|
|
|
372
|
-
expect(requestData.user.
|
|
372
|
+
expect(requestData.user.buyeruid).to.equal(bidRequests[0].userId.sharedid.id);
|
|
373
373
|
});
|
|
374
374
|
|
|
375
375
|
it('pubcid should be used when sharedid is empty', function () {
|
|
@@ -406,7 +406,7 @@ describe('Opera Ads Bid Adapter', function () {
|
|
|
406
406
|
requestData = JSON.parse(reqs[0].data);
|
|
407
407
|
}).to.not.throw();
|
|
408
408
|
|
|
409
|
-
expect(requestData.user.
|
|
409
|
+
expect(requestData.user.buyeruid).to.equal(bidRequests[0].userId.pubcid);
|
|
410
410
|
});
|
|
411
411
|
|
|
412
412
|
it('random uid will be generate when userId is empty', function () {
|
|
@@ -433,7 +433,7 @@ describe('Opera Ads Bid Adapter', function () {
|
|
|
433
433
|
requestData = JSON.parse(reqs[0].data);
|
|
434
434
|
}).to.not.throw();
|
|
435
435
|
|
|
436
|
-
expect(requestData.user.
|
|
436
|
+
expect(requestData.user.buyeruid).to.not.be.empty;
|
|
437
437
|
})
|
|
438
438
|
});
|
|
439
439
|
|
|
@@ -679,9 +679,41 @@ describe('Opera Ads Bid Adapter', function () {
|
|
|
679
679
|
});
|
|
680
680
|
});
|
|
681
681
|
|
|
682
|
-
describe('Test getUserSyncs', function () {
|
|
683
|
-
it('getUserSyncs should return empty array', function () {
|
|
684
|
-
|
|
682
|
+
describe('Test getUserSyncs with both iframe and pixel disabled', function () {
|
|
683
|
+
it('getUserSyncs should return an empty array', function () {
|
|
684
|
+
const syncOptions = {};
|
|
685
|
+
expect(spec.getUserSyncs(syncOptions)).to.be.an('array').that.is.empty;
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
describe('Test getUserSyncs with iframe enabled', function () {
|
|
690
|
+
it('getUserSyncs should return array', function () {
|
|
691
|
+
const syncOptions = {
|
|
692
|
+
iframeEnabled: true
|
|
693
|
+
}
|
|
694
|
+
const userSyncPixels = spec.getUserSyncs(syncOptions)
|
|
695
|
+
expect(userSyncPixels).to.have.lengthOf(1);
|
|
696
|
+
expect(userSyncPixels[0].url).to.equal('https://s.adx.opera.com/usersync/page')
|
|
697
|
+
});
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
describe('Test getUserSyncs with pixel enabled', function () {
|
|
701
|
+
it('getUserSyncs should return array', function () {
|
|
702
|
+
const serverResponse = {
|
|
703
|
+
body: {
|
|
704
|
+
'pixels': [
|
|
705
|
+
'https://b1.com/usersync',
|
|
706
|
+
'https://b2.com/usersync'
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
const syncOptions = {
|
|
711
|
+
pixelEnabled: true
|
|
712
|
+
}
|
|
713
|
+
const userSyncPixels = spec.getUserSyncs(syncOptions, [serverResponse])
|
|
714
|
+
expect(userSyncPixels).to.have.lengthOf(2);
|
|
715
|
+
expect(userSyncPixels[0].url).to.equal('https://b1.com/usersync')
|
|
716
|
+
expect(userSyncPixels[1].url).to.equal('https://b2.com/usersync')
|
|
685
717
|
});
|
|
686
718
|
});
|
|
687
719
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {expect} from 'chai';
|
|
2
|
+
import {spec} from 'modules/otmBidAdapter';
|
|
3
|
+
|
|
4
|
+
describe('otmBidAdapter', function () {
|
|
5
|
+
it('validate_pub_params', function () {
|
|
6
|
+
expect(spec.isBidRequestValid({
|
|
7
|
+
bidder: 'otm',
|
|
8
|
+
params: {
|
|
9
|
+
tid: '123',
|
|
10
|
+
bidfloor: 20
|
|
11
|
+
}
|
|
12
|
+
})).to.equal(true);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('validate_generated_params', function () {
|
|
16
|
+
let bidRequestData = [{
|
|
17
|
+
bidId: 'bid1234',
|
|
18
|
+
bidder: 'otm',
|
|
19
|
+
params: {
|
|
20
|
+
tid: '123',
|
|
21
|
+
bidfloor: 20
|
|
22
|
+
},
|
|
23
|
+
sizes: [[240, 400]]
|
|
24
|
+
}];
|
|
25
|
+
|
|
26
|
+
let request = spec.buildRequests(bidRequestData);
|
|
27
|
+
let req_data = request[0].data;
|
|
28
|
+
|
|
29
|
+
expect(req_data.bidid).to.equal('bid1234');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('validate_response_params', function () {
|
|
33
|
+
let bidRequestData = {
|
|
34
|
+
data: {
|
|
35
|
+
bidId: 'bid1234'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
let serverResponse = {
|
|
40
|
+
body: [
|
|
41
|
+
{
|
|
42
|
+
'auctionid': '3c6f8e22-541b-485c-9214-e974d9fb1b6f',
|
|
43
|
+
'cpm': 847.097,
|
|
44
|
+
'ad': '<html><body>test html</body></html>',
|
|
45
|
+
'w': 240,
|
|
46
|
+
'h': 400,
|
|
47
|
+
'currency': 'RUB',
|
|
48
|
+
'ttl': 300,
|
|
49
|
+
'creativeid': '1_7869053',
|
|
50
|
+
'bidid': '101f211def7c99',
|
|
51
|
+
'transactionid': 'transaction_id_1'
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
let bids = spec.interpretResponse(serverResponse, bidRequestData);
|
|
57
|
+
expect(bids).to.have.lengthOf(1);
|
|
58
|
+
let bid = bids[0];
|
|
59
|
+
expect(bid.cpm).to.equal(847.097);
|
|
60
|
+
expect(bid.currency).to.equal('RUB');
|
|
61
|
+
expect(bid.width).to.equal(240);
|
|
62
|
+
expect(bid.height).to.equal(400);
|
|
63
|
+
expect(bid.netRevenue).to.equal(true);
|
|
64
|
+
expect(bid.requestId).to.equal('101f211def7c99');
|
|
65
|
+
expect(bid.ad).to.equal('<html><body>test html</body></html>');
|
|
66
|
+
});
|
|
67
|
+
});
|