prebid.js 5.19.0 → 5.20.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/modules/airgridRtdProvider.js +1 -1
- package/modules/appnexusBidAdapter.js +5 -3
- package/modules/atsAnalyticsAdapter.js +67 -46
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/betweenBidAdapter.js +2 -1
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/gridBidAdapter.js +1 -0
- package/modules/ixBidAdapter.js +7 -1
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/livewrappedAnalyticsAdapter.js +5 -0
- package/modules/multibid/index.js +3 -3
- package/modules/nativoBidAdapter.js +5 -1
- package/modules/openxBidAdapter.js +1 -1
- 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/rtdModule/index.js +2 -2
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/trustxBidAdapter.js +8 -6
- package/modules/ventesBidAdapter.js +370 -0
- package/modules/ventesBidAdapter.md +94 -0
- package/modules/yahoosspBidAdapter.js +6 -6
- package/package.json +1 -1
- package/src/auction.js +11 -11
- package/test/spec/modules/appnexusBidAdapter_spec.js +2 -1
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
- package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
- package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/ixBidAdapter_spec.js +3 -3
- package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
- package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/openxBidAdapter_spec.js +0 -26
- 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/sonobiBidAdapter_spec.js +34 -1
- package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +3 -3
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/unit/core/adapterManager_spec.js +2 -1
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import {
|
|
3
|
+
BIDDER_CODE,
|
|
4
|
+
BIDDER_ENDPOINT_URL,
|
|
5
|
+
spec, USERSYNC_URL,
|
|
6
|
+
getBidFloor
|
|
7
|
+
} from 'modules/deltaprojectsBidAdapter.js';
|
|
8
|
+
|
|
9
|
+
const BID_REQ_REFER = 'http://example.com/page?param=val';
|
|
10
|
+
|
|
11
|
+
describe('deltaprojectsBidAdapter', function() {
|
|
12
|
+
describe('isBidRequestValid', function () {
|
|
13
|
+
function makeBid() {
|
|
14
|
+
return {
|
|
15
|
+
bidder: BIDDER_CODE,
|
|
16
|
+
params: {
|
|
17
|
+
publisherId: '12345'
|
|
18
|
+
},
|
|
19
|
+
adUnitCode: 'adunit-code',
|
|
20
|
+
sizes: [
|
|
21
|
+
[300, 250],
|
|
22
|
+
],
|
|
23
|
+
bidId: '30b31c1838de1e',
|
|
24
|
+
bidderRequestId: '22edbae2733bf6',
|
|
25
|
+
auctionId: '1d1a030790a475',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
it('should return true when bidder set correctly', function () {
|
|
30
|
+
expect(spec.isBidRequestValid(makeBid())).to.equal(true);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should return false when bid request is null', function () {
|
|
34
|
+
expect(spec.isBidRequestValid(undefined)).to.equal(false);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should return false when bidder not set correctly', function () {
|
|
38
|
+
let bid = makeBid();
|
|
39
|
+
delete bid.bidder;
|
|
40
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should return false when publisher id is not set', function () {
|
|
44
|
+
let bid = makeBid();
|
|
45
|
+
delete bid.params.publisherId;
|
|
46
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('buildRequests', function () {
|
|
51
|
+
const BIDREQ = {
|
|
52
|
+
bidder: BIDDER_CODE,
|
|
53
|
+
params: {
|
|
54
|
+
tagId: '403370',
|
|
55
|
+
siteId: 'example.com',
|
|
56
|
+
},
|
|
57
|
+
sizes: [
|
|
58
|
+
[300, 250],
|
|
59
|
+
],
|
|
60
|
+
bidId: '30b31c1838de1e',
|
|
61
|
+
bidderRequestId: '22edbae2733bf6',
|
|
62
|
+
auctionId: '1d1a030790a475',
|
|
63
|
+
}
|
|
64
|
+
const bidRequests = [BIDREQ];
|
|
65
|
+
const bannerRequest = spec.buildRequests(bidRequests, {refererInfo: { referer: BID_REQ_REFER }})[0];
|
|
66
|
+
const bannerRequestBody = bannerRequest.data;
|
|
67
|
+
|
|
68
|
+
it('send bid request with test tag if it is set in the param', function () {
|
|
69
|
+
const TEST_TAG = 1;
|
|
70
|
+
const bidRequest = Object.assign({}, BIDREQ, {
|
|
71
|
+
params: { ...BIDREQ.params, test: TEST_TAG },
|
|
72
|
+
});
|
|
73
|
+
const bidderRequest = { refererInfo: { referer: BID_REQ_REFER } };
|
|
74
|
+
const request = spec.buildRequests([bidRequest], bidderRequest)[0];
|
|
75
|
+
expect(request.data.test).to.equal(TEST_TAG);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('send bid request with correct timeout', function () {
|
|
79
|
+
const TMAX = 10;
|
|
80
|
+
const bidderRequest = { refererInfo: { referer: BID_REQ_REFER }, timeout: TMAX };
|
|
81
|
+
const request = spec.buildRequests(bidRequests, bidderRequest)[0];
|
|
82
|
+
expect(request.data.tmax).to.equal(TMAX);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('send bid request to the correct endpoint URL', function () {
|
|
86
|
+
expect(bannerRequest.url).to.equal(BIDDER_ENDPOINT_URL);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('sends bid request to our endpoint via POST', function () {
|
|
90
|
+
expect(bannerRequest.method).to.equal('POST');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('sends screen dimensions', function () {
|
|
94
|
+
expect(bannerRequestBody.device.w).to.equal(screen.width);
|
|
95
|
+
expect(bannerRequestBody.device.h).to.equal(screen.height);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('includes the ad size in the bid request', function () {
|
|
99
|
+
expect(bannerRequestBody.imp[0].banner.format[0].w).to.equal(BIDREQ.sizes[0][0]);
|
|
100
|
+
expect(bannerRequestBody.imp[0].banner.format[0].h).to.equal(BIDREQ.sizes[0][1]);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('sets domain and href correctly', function () {
|
|
104
|
+
expect(bannerRequestBody.site.domain).to.equal(BIDREQ.params.siteId);
|
|
105
|
+
expect(bannerRequestBody.site.page).to.equal(BID_REQ_REFER);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const gdprBidRequests = [{
|
|
109
|
+
bidder: BIDDER_CODE,
|
|
110
|
+
params: {
|
|
111
|
+
tagId: '403370',
|
|
112
|
+
siteId: 'example.com'
|
|
113
|
+
},
|
|
114
|
+
sizes: [
|
|
115
|
+
[300, 250]
|
|
116
|
+
],
|
|
117
|
+
bidId: '30b31c1838de1e',
|
|
118
|
+
bidderRequestId: '22edbae2733bf6',
|
|
119
|
+
auctionId: '1d1a030790a475'
|
|
120
|
+
}];
|
|
121
|
+
const consentString = 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==';
|
|
122
|
+
|
|
123
|
+
const GDPR_REQ_REFERER = 'http://localhost:9876/'
|
|
124
|
+
function getGdprRequestBody(gdprApplies, consentString) {
|
|
125
|
+
const gdprRequest = spec.buildRequests(gdprBidRequests, {
|
|
126
|
+
gdprConsent: {
|
|
127
|
+
gdprApplies: gdprApplies,
|
|
128
|
+
consentString: consentString,
|
|
129
|
+
},
|
|
130
|
+
refererInfo: {
|
|
131
|
+
referer: GDPR_REQ_REFERER,
|
|
132
|
+
},
|
|
133
|
+
})[0];
|
|
134
|
+
return gdprRequest.data;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
it('should handle gdpr applies being present and true', function() {
|
|
138
|
+
const gdprRequestBody = getGdprRequestBody(true, consentString);
|
|
139
|
+
expect(gdprRequestBody.regs.ext.gdpr).to.equal(1);
|
|
140
|
+
expect(gdprRequestBody.user.ext.consent).to.equal(consentString);
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
it('should handle gdpr applies being present and false', function() {
|
|
144
|
+
const gdprRequestBody = getGdprRequestBody(false, consentString);
|
|
145
|
+
expect(gdprRequestBody.regs.ext.gdpr).to.equal(0);
|
|
146
|
+
expect(gdprRequestBody.user.ext.consent).to.equal(consentString);
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
it('should handle gdpr applies being undefined', function() {
|
|
150
|
+
const gdprRequestBody = getGdprRequestBody(undefined, consentString);
|
|
151
|
+
expect(gdprRequestBody.regs).to.deep.equal({ext: {}});
|
|
152
|
+
expect(gdprRequestBody.user.ext.consent).to.equal(consentString);
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
it('should handle gdpr consent being undefined', function() {
|
|
156
|
+
const gdprRequest = spec.buildRequests(gdprBidRequests, {refererInfo: { referer: GDPR_REQ_REFERER }})[0];
|
|
157
|
+
const gdprRequestBody = gdprRequest.data;
|
|
158
|
+
expect(gdprRequestBody.regs).to.deep.equal({ ext: {} });
|
|
159
|
+
expect(gdprRequestBody.user).to.deep.equal({ ext: {} });
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
describe('interpretResponse', function () {
|
|
164
|
+
const bidRequests = [
|
|
165
|
+
{
|
|
166
|
+
bidder: BIDDER_CODE,
|
|
167
|
+
params: {
|
|
168
|
+
tagId: '403370',
|
|
169
|
+
siteId: 'example.com',
|
|
170
|
+
currency: 'USD',
|
|
171
|
+
},
|
|
172
|
+
sizes: [
|
|
173
|
+
[300, 250],
|
|
174
|
+
],
|
|
175
|
+
bidId: '30b31c1838de1e',
|
|
176
|
+
bidderRequestId: '22edbae2733bf6',
|
|
177
|
+
auctionId: '1d1a030790a475',
|
|
178
|
+
},
|
|
179
|
+
];
|
|
180
|
+
const request = spec.buildRequests(bidRequests, {refererInfo: { referer: BID_REQ_REFER }})[0];
|
|
181
|
+
function makeResponse() {
|
|
182
|
+
return {
|
|
183
|
+
body: {
|
|
184
|
+
id: '5e5c23a5ba71e78',
|
|
185
|
+
seatbid: [
|
|
186
|
+
{
|
|
187
|
+
bid: [
|
|
188
|
+
{
|
|
189
|
+
id: '6vmb3isptf',
|
|
190
|
+
crid: 'deltaprojectscreative',
|
|
191
|
+
impid: '322add653672f68',
|
|
192
|
+
price: 1.22,
|
|
193
|
+
adm: '<!-- creative -->',
|
|
194
|
+
attr: [5],
|
|
195
|
+
h: 90,
|
|
196
|
+
nurl: 'http://nurl',
|
|
197
|
+
w: 728,
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
seat: 'MOCK'
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
bidid: '5e5c23a5ba71e78',
|
|
204
|
+
cur: 'USD'
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const expectedBid = {
|
|
209
|
+
requestId: '322add653672f68',
|
|
210
|
+
cpm: 1.22,
|
|
211
|
+
width: 728,
|
|
212
|
+
height: 90,
|
|
213
|
+
creativeId: 'deltaprojectscreative',
|
|
214
|
+
dealId: null,
|
|
215
|
+
currency: 'USD',
|
|
216
|
+
netRevenue: true,
|
|
217
|
+
mediaType: 'banner',
|
|
218
|
+
ttl: 60,
|
|
219
|
+
ad: '<!-- creative --><div style="position:absolute;left:0px;top:0px;visibility:hidden;"><img src="http://nurl"></div>'
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
it('should get incorrect bid response if response body is missing', function () {
|
|
223
|
+
let response = makeResponse();
|
|
224
|
+
delete response.body;
|
|
225
|
+
let result = spec.interpretResponse(response, request);
|
|
226
|
+
expect(result.length).to.equal(0);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it('should get incorrect bid response if id or seat id of response body is missing', function () {
|
|
230
|
+
let response1 = makeResponse();
|
|
231
|
+
delete response1.body.id;
|
|
232
|
+
let result1 = spec.interpretResponse(response1, request);
|
|
233
|
+
expect(result1.length).to.equal(0);
|
|
234
|
+
|
|
235
|
+
let response2 = makeResponse();
|
|
236
|
+
delete response2.body.seatbid;
|
|
237
|
+
let result2 = spec.interpretResponse(response2, request);
|
|
238
|
+
expect(result2.length).to.equal(0);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it('should get the correct bid response', function () {
|
|
242
|
+
let result = spec.interpretResponse(makeResponse(), request);
|
|
243
|
+
expect(result.length).to.equal(1);
|
|
244
|
+
expect(result[0]).to.deep.equal(expectedBid);
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
it('should handle a missing crid', function () {
|
|
248
|
+
let noCridResponse = makeResponse();
|
|
249
|
+
delete noCridResponse.body.seatbid[0].bid[0].crid;
|
|
250
|
+
const fallbackCrid = noCridResponse.body.seatbid[0].bid[0].id;
|
|
251
|
+
let noCridResult = Object.assign({}, expectedBid, {'creativeId': fallbackCrid});
|
|
252
|
+
let result = spec.interpretResponse(noCridResponse, request);
|
|
253
|
+
expect(result.length).to.equal(1);
|
|
254
|
+
expect(result[0]).to.deep.equal(noCridResult);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('should handle a missing nurl', function () {
|
|
258
|
+
let noNurlResponse = makeResponse();
|
|
259
|
+
delete noNurlResponse.body.seatbid[0].bid[0].nurl;
|
|
260
|
+
let noNurlResult = Object.assign({}, expectedBid);
|
|
261
|
+
noNurlResult.ad = '<!-- creative -->';
|
|
262
|
+
let result = spec.interpretResponse(noNurlResponse, request);
|
|
263
|
+
expect(result.length).to.equal(1);
|
|
264
|
+
expect(result[0]).to.deep.equal(noNurlResult);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('handles empty bid response', function () {
|
|
268
|
+
let response = {
|
|
269
|
+
body: {
|
|
270
|
+
id: '5e5c23a5ba71e78',
|
|
271
|
+
seatbid: []
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
let result = spec.interpretResponse(response, request);
|
|
275
|
+
expect(result.length).to.equal(0);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it('should keep custom properties', () => {
|
|
279
|
+
const customProperties = {test: 'a test message', param: {testParam: 1}};
|
|
280
|
+
const expectedResult = Object.assign({}, expectedBid, {[spec.code]: customProperties});
|
|
281
|
+
const response = makeResponse();
|
|
282
|
+
response.body.seatbid[0].bid[0].ext = customProperties;
|
|
283
|
+
const result = spec.interpretResponse(response, request);
|
|
284
|
+
expect(result.length).to.equal(1);
|
|
285
|
+
expect(result[0]).to.deep.equal(expectedResult);
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
describe('onBidWon', function () {
|
|
290
|
+
const OPEN_RTB_RESP = {
|
|
291
|
+
body: {
|
|
292
|
+
id: 'abc',
|
|
293
|
+
seatbid: [
|
|
294
|
+
{
|
|
295
|
+
bid: [
|
|
296
|
+
{
|
|
297
|
+
'id': 'abc*123*456',
|
|
298
|
+
'impid': 'xxxxxxx',
|
|
299
|
+
'price': 46.657196,
|
|
300
|
+
'adm': '<iframe id="dsp_iframe_228285197" src="https//abc/${AUCTION_PRICE:B64}&creative_id=123"></script>',
|
|
301
|
+
'adomain': ['deltaprojects.com'],
|
|
302
|
+
'h': 600,
|
|
303
|
+
'w': 300,
|
|
304
|
+
'cid': '868253',
|
|
305
|
+
'crid': '732935',
|
|
306
|
+
'cat': [],
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
'seat': '2147483647',
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
bidid: 'xyz',
|
|
313
|
+
cur: 'USD',
|
|
314
|
+
},
|
|
315
|
+
}
|
|
316
|
+
it('should replace auction price macro', () => {
|
|
317
|
+
const bid = spec.interpretResponse(OPEN_RTB_RESP)[0];
|
|
318
|
+
spec.onBidWon(bid);
|
|
319
|
+
expect(bid.ad).to.contains(`${Math.round(bid.cpm * 1000000)}`);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
describe('getUserSyncs', function () {
|
|
324
|
+
it('should not do user sync when pixel is disabled', () => {
|
|
325
|
+
const syncOptions = { pixelEnabled: false }
|
|
326
|
+
const result = spec.getUserSyncs(syncOptions)
|
|
327
|
+
expect(result.length).to.equal(0);
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
it('should do user sync without gdpr params when gdprConsent missing', () => {
|
|
331
|
+
const syncOptions = { pixelEnabled: true }
|
|
332
|
+
const gdprConsent = undefined
|
|
333
|
+
const result = spec.getUserSyncs(syncOptions, gdprConsent)
|
|
334
|
+
expect(result[0].url).to.equal(USERSYNC_URL);
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it('should do user sync with gdpr params when gdprConsent exists', () => {
|
|
338
|
+
const syncOptions = { pixelEnabled: true }
|
|
339
|
+
const gdprConsent = {
|
|
340
|
+
gdprApplies: true,
|
|
341
|
+
consentString: 'ABCABCABC'
|
|
342
|
+
}
|
|
343
|
+
const expectedResult1 = USERSYNC_URL + `?gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`
|
|
344
|
+
const result1 = spec.getUserSyncs(syncOptions, {}, gdprConsent)
|
|
345
|
+
expect(result1[0].url).to.equal(expectedResult1);
|
|
346
|
+
|
|
347
|
+
delete gdprConsent.gdprApplies
|
|
348
|
+
const result2 = spec.getUserSyncs(syncOptions, {}, gdprConsent)
|
|
349
|
+
const expectedResult2 = USERSYNC_URL + `?gdpr_consent=${gdprConsent.consentString}`
|
|
350
|
+
expect(result2[0].url).to.equal(expectedResult2);
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
describe('getBidFloor', () => {
|
|
355
|
+
it('should not get bid floor when getFloor is not defined', () => {
|
|
356
|
+
const bid = {};
|
|
357
|
+
const currency = 'SEK';
|
|
358
|
+
const result = getBidFloor(bid, 'banner', '*', currency);
|
|
359
|
+
expect(result).to.be.undefined;
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
it('should not get bid floor when getFloor is not a function', () => {
|
|
363
|
+
const bid = { getFloor: 1.0 };
|
|
364
|
+
const currency = 'SEK';
|
|
365
|
+
const result = getBidFloor(bid, 'banner', '*', currency);
|
|
366
|
+
expect(result).to.be.undefined;
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
it('should not get bid floor when getFloor return empty', () => {
|
|
370
|
+
const bid = { getFloor: () => ({}) };
|
|
371
|
+
const currency = 'SEK';
|
|
372
|
+
const result = getBidFloor(bid, 'banner', '*', currency);
|
|
373
|
+
expect(result).to.be.undefined;
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it('should not get bid floor in SEK when floor is not a number', () => {
|
|
377
|
+
const bid = { getFloor: () => ({ currency: 'SEK', floor: '1.0' }) };
|
|
378
|
+
const currency = 'SEK';
|
|
379
|
+
const result = getBidFloor(bid, 'banner', '*', currency);
|
|
380
|
+
expect(result).to.be.undefined;
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
it('should get bid floor in USD when currency is not defined', () => {
|
|
384
|
+
const bid = { getFloor: () => ({ currency: 'USD', floor: 1.0 }) };
|
|
385
|
+
const currency = undefined;
|
|
386
|
+
const result = getBidFloor(bid, 'banner', '*', currency);
|
|
387
|
+
expect(result.floor).to.equal(1.0);
|
|
388
|
+
expect(result.currency).to.equal('USD');
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
it('should get bid floor in SEK when currency is SEK', () => {
|
|
392
|
+
const bid = { getFloor: () => ({ currency: 'SEK', floor: 1.0 }) };
|
|
393
|
+
const currency = 'SEK';
|
|
394
|
+
const result = getBidFloor(bid, 'banner', '*', currency);
|
|
395
|
+
expect(result.floor).to.equal(1.0);
|
|
396
|
+
expect(result.currency).to.equal('SEK');
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
});
|
|
@@ -1405,16 +1405,16 @@ describe('IndexexchangeAdapter', function () {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
};
|
|
1407
1407
|
const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
|
|
1408
|
-
const { dfp_ad_unit_code } = JSON.parse(requests[0].data.r).imp[0]
|
|
1408
|
+
const { ext: { dfp_ad_unit_code } } = JSON.parse(requests[0].data.r).imp[0];
|
|
1409
1409
|
expect(dfp_ad_unit_code).to.equal(AD_UNIT_CODE);
|
|
1410
1410
|
});
|
|
1411
1411
|
|
|
1412
1412
|
it('should not send dfp_adunit_code in request if ortb2Imp.ext.data.adserver.adslot does not exists', function () {
|
|
1413
1413
|
const validBids = utils.deepClone(DEFAULT_BANNER_VALID_BID);
|
|
1414
1414
|
const requests = spec.buildRequests(validBids, DEFAULT_OPTION);
|
|
1415
|
-
const {
|
|
1415
|
+
const { ext } = JSON.parse(requests[0].data.r).imp[0];
|
|
1416
1416
|
|
|
1417
|
-
expect(
|
|
1417
|
+
expect(ext).to.not.exist;
|
|
1418
1418
|
});
|
|
1419
1419
|
|
|
1420
1420
|
it('payload should have correct format and value', function () {
|
|
@@ -9,6 +9,7 @@ describe('jixie Adapter', function () {
|
|
|
9
9
|
const device_ = 'desktop';
|
|
10
10
|
const timeout_ = 1000;
|
|
11
11
|
const currency_ = 'USD';
|
|
12
|
+
const keywords_ = '';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Basic
|
|
@@ -212,7 +213,7 @@ describe('jixie Adapter', function () {
|
|
|
212
213
|
);
|
|
213
214
|
let miscDimsStub = sinon.stub(jixieaux, 'getMiscDims');
|
|
214
215
|
miscDimsStub
|
|
215
|
-
.returns({ device: device_, pageurl: pageurl_, domain: domain_ });
|
|
216
|
+
.returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
|
|
216
217
|
|
|
217
218
|
// actual api call:
|
|
218
219
|
const request = spec.buildRequests(bidRequests_, bidderRequest_);
|
|
@@ -229,6 +230,7 @@ describe('jixie Adapter', function () {
|
|
|
229
230
|
expect(payload).to.have.property('device', device_);
|
|
230
231
|
expect(payload).to.have.property('domain', domain_);
|
|
231
232
|
expect(payload).to.have.property('pageurl', pageurl_);
|
|
233
|
+
expect(payload).to.have.property('mkeywords', keywords_);
|
|
232
234
|
expect(payload).to.have.property('timeout', timeout_);
|
|
233
235
|
expect(payload).to.have.property('currency', currency_);
|
|
234
236
|
expect(payload).to.have.property('bids').that.deep.equals(refBids_);
|
|
@@ -243,15 +245,15 @@ describe('jixie Adapter', function () {
|
|
|
243
245
|
/**
|
|
244
246
|
* interpretResponse:
|
|
245
247
|
*/
|
|
246
|
-
const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.
|
|
247
|
-
const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.
|
|
248
|
+
const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/dummyscript.js';
|
|
249
|
+
const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js';
|
|
248
250
|
|
|
249
|
-
const mockVastXml_ = `<?xml version="1.0" encoding="UTF-8"?><VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0"><Ad id="JXAD521"><InLine><AdSystem>JXADSERVER</AdSystem><AdTitle>Alway%20Live%20Prebid%20Creative</AdTitle><Description>Hybrid in-stream</Description><Error><![CDATA[https://demo.com?action=error&errorcode=[ERRORCODE]&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Error><Impression><![CDATA[https://demo.com?action=impression&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Impression><Creatives><Creative id="JXAD521" sequence="1"><Linear><Duration>00:00:10</Duration><TrackingEvents><Tracking event="start"><![CDATA[https://demo.com?action=start&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="firstQuartile"><![CDATA[https://demo.com?action=firstQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="midpoint"><![CDATA[https://demo.com?action=midpoint&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="thirdQuartile"><![CDATA[https://demo.com?action=thirdQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="complete"><![CDATA[https://demo.com?action=complete&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="mute"><![CDATA[https://demo.com?action=mute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="unmute"><![CDATA[https://demo.com?action=unmute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="rewind"><![CDATA[https://demo.com?action=rewind&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="pause"><![CDATA[https://demo.com?action=pause&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="resume"><![CDATA[https://demo.com?action=resume&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="fullscreen"><![CDATA[https://demo.com?action=fullscreen&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="creativeView"><![CDATA[https://demo.com?action=creativeView&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking></TrackingEvents><VideoClicks><ClickThrough><![CDATA[https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category]]></ClickThrough><ClickTracking id="521"><![CDATA[https://demo.com?action=click&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></ClickTracking></VideoClicks><MediaFiles><MediaFile apiFramework="VPAID" type="application/javascript"><![CDATA[https://creatives.b-cdn.net/js/jxvpaid_1_0.min.js]]></MediaFile></MediaFiles><AdParameters><![CDATA[{"embed":true,"videos":[{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_240.mp4","bitrate":186,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_360.mp4","bitrate":229,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_480.mp4","bitrate":279,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_720.mp4","bitrate":325,"mimetype":"video/mp4"}],"countpos":"left","hotspots":[{"type":"direct_url","start":0,"duration":10,"position":"top-right","direct_url":"https://toko-iot.com/catalogue/category/audio_8/?utm_source=ivs&utm_medium=banner&utm_campaign=promo&utm_content=audio_category","thumbnail_url":"https://creatives.ivideosmart.com/hotspots/TokoIOT_1.gif","thumbnail_style":"full-height"}],"clickthru":"https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category","reporting":{},"skipoffset":5}]]></AdParameters><Icons><Icon program="AdChoices" width="20" height="20" xPosition="right" yPosition="top" offset="00:00:02"><StaticResource creativeType="image/png"><![CDATA[https://creatives.jixie.
|
|
251
|
+
const mockVastXml_ = `<?xml version="1.0" encoding="UTF-8"?><VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0"><Ad id="JXAD521"><InLine><AdSystem>JXADSERVER</AdSystem><AdTitle>Alway%20Live%20Prebid%20Creative</AdTitle><Description>Hybrid in-stream</Description><Error><![CDATA[https://demo.com?action=error&errorcode=[ERRORCODE]&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Error><Impression><![CDATA[https://demo.com?action=impression&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Impression><Creatives><Creative id="JXAD521" sequence="1"><Linear><Duration>00:00:10</Duration><TrackingEvents><Tracking event="start"><![CDATA[https://demo.com?action=start&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="firstQuartile"><![CDATA[https://demo.com?action=firstQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="midpoint"><![CDATA[https://demo.com?action=midpoint&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="thirdQuartile"><![CDATA[https://demo.com?action=thirdQuartile&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="complete"><![CDATA[https://demo.com?action=complete&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="mute"><![CDATA[https://demo.com?action=mute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="unmute"><![CDATA[https://demo.com?action=unmute&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="rewind"><![CDATA[https://demo.com?action=rewind&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="pause"><![CDATA[https://demo.com?action=pause&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="resume"><![CDATA[https://demo.com?action=resume&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="fullscreen"><![CDATA[https://demo.com?action=fullscreen&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking><Tracking event="creativeView"><![CDATA[https://demo.com?action=creativeView&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></Tracking></TrackingEvents><VideoClicks><ClickThrough><![CDATA[https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category]]></ClickThrough><ClickTracking id="521"><![CDATA[https://demo.com?action=click&mediaurl=[ASSETURI]&abc=1&stackidx=0]]></ClickTracking></VideoClicks><MediaFiles><MediaFile apiFramework="VPAID" type="application/javascript"><![CDATA[https://creatives.b-cdn.net/js/jxvpaid_1_0.min.js]]></MediaFile></MediaFiles><AdParameters><![CDATA[{"embed":true,"videos":[{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_240.mp4","bitrate":186,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_360.mp4","bitrate":229,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_480.mp4","bitrate":279,"mimetype":"video/mp4"},{"url":"https://creative-ivstream.ivideosmart.com/3001004/954006/3001004-954006_720.mp4","bitrate":325,"mimetype":"video/mp4"}],"countpos":"left","hotspots":[{"type":"direct_url","start":0,"duration":10,"position":"top-right","direct_url":"https://toko-iot.com/catalogue/category/audio_8/?utm_source=ivs&utm_medium=banner&utm_campaign=promo&utm_content=audio_category","thumbnail_url":"https://creatives.ivideosmart.com/hotspots/TokoIOT_1.gif","thumbnail_style":"full-height"}],"clickthru":"https://toko-iot.com/search/?q=Sonos&utm_source=ivs&utm_medium=video&utm_campaign=promo&utm_content=sonos_category","reporting":{},"skipoffset":5}]]></AdParameters><Icons><Icon program="AdChoices" width="20" height="20" xPosition="right" yPosition="top" offset="00:00:02"><StaticResource creativeType="image/png"><![CDATA[https://creatives.jixie.media/jxadchoice.png]]></StaticResource><IconClicks><IconClickThrough><![CDATA[https://www.jixie.io/privacy-policy]]></IconClickThrough></IconClicks></Icon></Icons></Linear></Creative><Creative sequence="1"/></Creatives></InLine></Ad></VAST>`;
|
|
250
252
|
const responseBody_ = {
|
|
251
253
|
'bids': [
|
|
252
254
|
// video (vast tag url) returned here
|
|
253
255
|
{
|
|
254
|
-
'trackingUrlBase': 'https://
|
|
256
|
+
'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
|
|
255
257
|
'jxBidId': '62847e4c696edcb-028d5dee-2c83-44e3-bed1-b75002475cdf',
|
|
256
258
|
'requestId': '62847e4c696edcb',
|
|
257
259
|
'cpm': 2.19,
|
|
@@ -284,7 +286,7 @@ describe('jixie Adapter', function () {
|
|
|
284
286
|
// display ad returned here: This one there is advertiserDomains
|
|
285
287
|
// in the response . Will be checked in the unit tests below
|
|
286
288
|
{
|
|
287
|
-
'trackingUrlBase': 'https://
|
|
289
|
+
'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
|
|
288
290
|
'jxBidId': '600c9ae6fda1acb-028d5dee-2c83-44e3-bed1-b75002475cdf',
|
|
289
291
|
'requestId': '600c9ae6fda1acb',
|
|
290
292
|
'cpm': 1.999,
|
|
@@ -317,11 +319,11 @@ describe('jixie Adapter', function () {
|
|
|
317
319
|
],
|
|
318
320
|
'mediaType': 'BANNER'
|
|
319
321
|
},
|
|
320
|
-
'ad': '<div id="jxoutstream" style="width: 100%;"> <script type="text/javascript" src="https://scripts.jixie.
|
|
322
|
+
'ad': '<div id="jxoutstream" style="width: 100%;"> <script type="text/javascript" src="https://scripts.jixie.media/jxfriendly.1.3.min.js" defer=""></script> <script> var p ={ responsive: 1, nested: 1, maxwidth: 640, container: "jxoutstream", creativeid: 520}; function jxdefer(p) { if (window.jxuniversal) { window.jxuniversal.init(p); } else { setTimeout(function() { jxdefer(p) }, 100); } } jxdefer(p); </script> </div>'
|
|
321
323
|
},
|
|
322
324
|
// outstream, jx non-default renderer specified:
|
|
323
325
|
{
|
|
324
|
-
'trackingUrlBase': 'https://
|
|
326
|
+
'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
|
|
325
327
|
'jxBidId': '99bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf',
|
|
326
328
|
'requestId': '99bc539c81b00ce',
|
|
327
329
|
'cpm': 2.99,
|
|
@@ -340,7 +342,7 @@ describe('jixie Adapter', function () {
|
|
|
340
342
|
},
|
|
341
343
|
// outstream, jx default renderer:
|
|
342
344
|
{
|
|
343
|
-
'trackingUrlBase': 'https://
|
|
345
|
+
'trackingUrlBase': 'https://traid.jixie.io/sync/ad?',
|
|
344
346
|
'jxBidId': '61bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf',
|
|
345
347
|
'requestId': '61bc539c81b00ce',
|
|
346
348
|
'cpm': 1.99,
|
|
@@ -475,7 +477,7 @@ describe('jixie Adapter', function () {
|
|
|
475
477
|
ajaxStub = sinon.stub(jixieaux, 'ajax');
|
|
476
478
|
|
|
477
479
|
miscDimsStub
|
|
478
|
-
.returns({ device: device_, pageurl: pageurl_, domain: domain_ });
|
|
480
|
+
.returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
|
|
479
481
|
})
|
|
480
482
|
|
|
481
483
|
afterEach(function() {
|
|
@@ -537,7 +539,7 @@ describe('jixie Adapter', function () {
|
|
|
537
539
|
ajaxStub = sinon.stub(jixieaux, 'ajax');
|
|
538
540
|
miscDimsStub = sinon.stub(jixieaux, 'getMiscDims');
|
|
539
541
|
miscDimsStub
|
|
540
|
-
.returns({ device: device_, pageurl: pageurl_, domain: domain_ });
|
|
542
|
+
.returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ });
|
|
541
543
|
})
|
|
542
544
|
|
|
543
545
|
afterEach(function() {
|
|
@@ -97,7 +97,7 @@ describe('justpremium adapter', function () {
|
|
|
97
97
|
expect(jpxRequest.id).to.equal(adUnits[0].params.zone)
|
|
98
98
|
expect(jpxRequest.mediaTypes && jpxRequest.mediaTypes.banner && jpxRequest.mediaTypes.banner.sizes).to.not.equal('undefined')
|
|
99
99
|
expect(jpxRequest.version.prebid).to.equal('$prebid.version$')
|
|
100
|
-
expect(jpxRequest.version.jp_adapter).to.equal('1.8')
|
|
100
|
+
expect(jpxRequest.version.jp_adapter).to.equal('1.8.1')
|
|
101
101
|
expect(jpxRequest.pubcid).to.equal('0000000')
|
|
102
102
|
expect(jpxRequest.uids.tdid).to.equal('1111111')
|
|
103
103
|
expect(jpxRequest.uids.id5id.uid).to.equal('2222222')
|
|
@@ -118,7 +118,10 @@ describe('justpremium adapter', function () {
|
|
|
118
118
|
'price': 0.52,
|
|
119
119
|
'format': 'lb',
|
|
120
120
|
'adm': 'creative code',
|
|
121
|
-
'adomain': ['justpremium.com']
|
|
121
|
+
'adomain': ['justpremium.com'],
|
|
122
|
+
'ext': {
|
|
123
|
+
'pg': true
|
|
124
|
+
}
|
|
122
125
|
}]
|
|
123
126
|
},
|
|
124
127
|
'pass': {
|
|
@@ -142,6 +145,9 @@ describe('justpremium adapter', function () {
|
|
|
142
145
|
meta: {
|
|
143
146
|
advertiserDomains: ['justpremium.com']
|
|
144
147
|
},
|
|
148
|
+
adserverTargeting: {
|
|
149
|
+
'hb_deal_justpremium': 'jp_pg'
|
|
150
|
+
}
|
|
145
151
|
}
|
|
146
152
|
]
|
|
147
153
|
|
|
@@ -159,6 +165,7 @@ describe('justpremium adapter', function () {
|
|
|
159
165
|
expect(result[0].netRevenue).to.equal(true)
|
|
160
166
|
expect(result[0].format).to.equal('lb')
|
|
161
167
|
expect(result[0].meta.advertiserDomains[0]).to.equal('justpremium.com')
|
|
168
|
+
expect(result[0].adserverTargeting).to.deep.equal({'hb_deal_justpremium': 'jp_pg'})
|
|
162
169
|
})
|
|
163
170
|
|
|
164
171
|
it('Verify wrong server response', function () {
|
|
@@ -2,6 +2,7 @@ import livewrappedAnalyticsAdapter, { BID_WON_TIMEOUT } from 'modules/livewrappe
|
|
|
2
2
|
import CONSTANTS from 'src/constants.json';
|
|
3
3
|
import { config } from 'src/config.js';
|
|
4
4
|
import { server } from 'test/mocks/xhr.js';
|
|
5
|
+
import { setConfig } from 'modules/currency.js';
|
|
5
6
|
|
|
6
7
|
let events = require('src/events');
|
|
7
8
|
let utils = require('src/utils');
|
|
@@ -28,6 +29,9 @@ const BID1 = {
|
|
|
28
29
|
width: 980,
|
|
29
30
|
height: 240,
|
|
30
31
|
cpm: 1.1,
|
|
32
|
+
originalCpm: 12.0,
|
|
33
|
+
currency: 'USD',
|
|
34
|
+
originalCurrency: 'FOO',
|
|
31
35
|
timeToRespond: 200,
|
|
32
36
|
bidId: '2ecff0db240757',
|
|
33
37
|
requestId: '2ecff0db240757',
|
|
@@ -43,6 +47,9 @@ const BID2 = Object.assign({}, BID1, {
|
|
|
43
47
|
width: 300,
|
|
44
48
|
height: 250,
|
|
45
49
|
cpm: 2.2,
|
|
50
|
+
originalCpm: 23.0,
|
|
51
|
+
currency: 'USD',
|
|
52
|
+
originalCurrency: 'FOO',
|
|
46
53
|
timeToRespond: 300,
|
|
47
54
|
bidId: '3ecff0db240757',
|
|
48
55
|
requestId: '3ecff0db240757',
|
|
@@ -178,6 +185,7 @@ const ANALYTICS_MESSAGE = {
|
|
|
178
185
|
width: 980,
|
|
179
186
|
height: 240,
|
|
180
187
|
cpm: 1.1,
|
|
188
|
+
orgCpm: 120,
|
|
181
189
|
ttr: 200,
|
|
182
190
|
IsBid: true,
|
|
183
191
|
mediaType: 1,
|
|
@@ -192,6 +200,7 @@ const ANALYTICS_MESSAGE = {
|
|
|
192
200
|
width: 300,
|
|
193
201
|
height: 250,
|
|
194
202
|
cpm: 2.2,
|
|
203
|
+
orgCpm: 230,
|
|
195
204
|
ttr: 300,
|
|
196
205
|
IsBid: true,
|
|
197
206
|
mediaType: 1,
|
|
@@ -219,6 +228,7 @@ const ANALYTICS_MESSAGE = {
|
|
|
219
228
|
width: 980,
|
|
220
229
|
height: 240,
|
|
221
230
|
cpm: 1.1,
|
|
231
|
+
orgCpm: 120,
|
|
222
232
|
mediaType: 1,
|
|
223
233
|
gdpr: 0,
|
|
224
234
|
auctionId: 0
|
|
@@ -231,6 +241,7 @@ const ANALYTICS_MESSAGE = {
|
|
|
231
241
|
width: 300,
|
|
232
242
|
height: 250,
|
|
233
243
|
cpm: 2.2,
|
|
244
|
+
orgCpm: 230,
|
|
234
245
|
mediaType: 1,
|
|
235
246
|
gdpr: 0,
|
|
236
247
|
auctionId: 0
|
|
@@ -279,6 +290,14 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
279
290
|
sandbox.stub(document, 'getElementById').returns(element);
|
|
280
291
|
|
|
281
292
|
clock = sandbox.useFakeTimers(1519767013781);
|
|
293
|
+
setConfig({
|
|
294
|
+
adServerCurrency: 'USD',
|
|
295
|
+
rates: {
|
|
296
|
+
USD: {
|
|
297
|
+
FOO: 0.1
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
});
|
|
282
301
|
});
|
|
283
302
|
|
|
284
303
|
afterEach(function () {
|
|
@@ -453,7 +472,7 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
453
472
|
{
|
|
454
473
|
'floorData': {
|
|
455
474
|
'floorValue': 1.1,
|
|
456
|
-
'floorCurrency': '
|
|
475
|
+
'floorCurrency': 'FOO'
|
|
457
476
|
}
|
|
458
477
|
}));
|
|
459
478
|
events.emit(BID_WON, Object.assign({},
|
|
@@ -461,7 +480,7 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
461
480
|
{
|
|
462
481
|
'floorData': {
|
|
463
482
|
'floorValue': 1.1,
|
|
464
|
-
'floorCurrency': '
|
|
483
|
+
'floorCurrency': 'FOO'
|
|
465
484
|
}
|
|
466
485
|
}));
|
|
467
486
|
events.emit(AUCTION_END, MOCK.AUCTION_END);
|
|
@@ -476,11 +495,11 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
476
495
|
|
|
477
496
|
expect(message.responses.length).to.equal(1);
|
|
478
497
|
expect(message.responses[0].floor).to.equal(1.1);
|
|
479
|
-
expect(message.responses[0].floorCur).to.equal('
|
|
498
|
+
expect(message.responses[0].floorCur).to.equal('FOO');
|
|
480
499
|
|
|
481
500
|
expect(message.wins.length).to.equal(1);
|
|
482
501
|
expect(message.wins[0].floor).to.equal(1.1);
|
|
483
|
-
expect(message.wins[0].floorCur).to.equal('
|
|
502
|
+
expect(message.wins[0].floorCur).to.equal('FOO');
|
|
484
503
|
});
|
|
485
504
|
|
|
486
505
|
it('should forward Livewrapped floor data', function () {
|