prebid.js 9.53.3 → 9.53.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/33acrossAnalyticsAdapter.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/BTBidAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adagioUtils.js +1 -1
- package/dist/addefendBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adstirBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/agmaAnalyticsAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/aniviewBidAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidderTimeoutUtils.js +1 -0
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bitmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgeuppBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/chunk-core.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/contxtfulBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dailymotionBidAdapter.js +1 -1
- package/dist/dependencies.json +10 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/equativBidAdapter.js +1 -1
- package/dist/eskimiBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/exadsBidAdapter.js +1 -1
- package/dist/excoBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/fwsspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsBidAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmobiBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kimberliteBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentId.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -1
- package/dist/madsenseBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetBidAdapter.js +1 -1
- package/dist/medianetUtils.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/mobilefuseBidAdapter.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/nexx360Utils.js +1 -1
- package/dist/nobidAnalyticsAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/nodalsAiRtdProvider.js +1 -1
- package/dist/not-for-prod/prebid.js +175 -172
- package/dist/objectGuard.js +1 -1
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optableRtdProvider.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/orbidderBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubmaticRtdProvider.js +1 -1
- package/dist/pubmaticUtils.js +1 -0
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseUtils.js +1 -1
- package/dist/rtdModule.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sevioBidAdapter.js +1 -0
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/showheroes-bsBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/snigelBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sparteoBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/themoneytizerBidAdapter.js +1 -1
- package/dist/timeoutRtdProvider.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/unrulyBidAdapter.js +1 -1
- package/dist/vidazooUtils.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahooAdsBidAdapter.js +1 -1
- package/dist/yandexBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/pubmaticRtdProvider_Example.html +161 -0
- package/libraries/bidderTimeoutUtils/bidderTimeoutUtils.js +119 -0
- package/libraries/objectGuard/objectGuard.js +36 -15
- package/libraries/pubmaticUtils/plugins/dynamicTimeout.js +209 -0
- package/libraries/pubmaticUtils/plugins/floorProvider.js +168 -0
- package/libraries/pubmaticUtils/plugins/pluginManager.js +106 -0
- package/libraries/pubmaticUtils/plugins/unifiedPricingRule.js +375 -0
- package/libraries/pubmaticUtils/pubmaticUtils.js +76 -0
- package/modules/fwsspBidAdapter.js +134 -69
- package/modules/fwsspBidAdapter.md +121 -26
- package/modules/optableRtdProvider.js +33 -12
- package/modules/pubmaticAnalyticsAdapter.js +5 -1
- package/modules/pubmaticRtdProvider.js +105 -565
- package/modules/rtdModule/index.js +23 -2
- package/modules/sevioBidAdapter.js +413 -0
- package/modules/sevioBidAdapter.md +29 -0
- package/modules/sparteoBidAdapter.js +122 -10
- package/modules/timeoutRtdProvider.js +2 -105
- package/package.json +1 -1
- package/test/spec/activities/objectGuard_spec.js +49 -16
- package/test/spec/libraries/bidderTimeoutUtils/bidderTimeoutUtils_spec.js +213 -0
- package/test/spec/libraries/pubmaticUtils/plugins/dynamicTimeout_spec.js +746 -0
- package/test/spec/libraries/pubmaticUtils/plugins/floorProvider_spec.js +184 -0
- package/test/spec/libraries/pubmaticUtils/plugins/pluginManager_spec.js +489 -0
- package/test/spec/libraries/pubmaticUtils/plugins/unifiedPricingRule_spec.js +359 -0
- package/test/spec/libraries/pubmaticUtils/pubmaticUtils_spec.js +236 -0
- package/test/spec/modules/fwsspBidAdapter_spec.js +513 -78
- package/test/spec/modules/optableRtdProvider_spec.js +55 -5
- package/test/spec/modules/pubmaticRtdProvider_spec.js +252 -1183
- package/test/spec/modules/realTimeDataModule_spec.js +58 -8
- package/test/spec/modules/sevioBidAdapter_spec.js +513 -0
- package/test/spec/modules/sparteoBidAdapter_spec.js +528 -43
- package/test/spec/modules/timeoutRtdProvider_spec.js +1 -201
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {expect} from 'chai';
|
|
1
|
+
import { expect } from 'chai';
|
|
2
2
|
import { deepClone, mergeDeep } from 'src/utils';
|
|
3
|
-
import {spec as adapter} from 'modules/sparteoBidAdapter';
|
|
3
|
+
import { spec as adapter } from 'modules/sparteoBidAdapter';
|
|
4
4
|
|
|
5
5
|
const CURRENCY = 'EUR';
|
|
6
6
|
const TTL = 60;
|
|
7
7
|
const HTTP_METHOD = 'POST';
|
|
8
|
-
const REQUEST_URL = 'https://bid.sparteo.com/auction';
|
|
8
|
+
const REQUEST_URL = 'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=dev.sparteo.com';
|
|
9
9
|
const USER_SYNC_URL_IFRAME = 'https://sync.sparteo.com/sync/iframe.html?from=prebidjs';
|
|
10
10
|
|
|
11
11
|
const VALID_BID_BANNER = {
|
|
@@ -79,6 +79,7 @@ const VALID_REQUEST_BANNER = {
|
|
|
79
79
|
}
|
|
80
80
|
}],
|
|
81
81
|
'site': {
|
|
82
|
+
'domain': 'dev.sparteo.com',
|
|
82
83
|
'publisher': {
|
|
83
84
|
'ext': {
|
|
84
85
|
'params': {
|
|
@@ -123,6 +124,7 @@ const VALID_REQUEST_VIDEO = {
|
|
|
123
124
|
}
|
|
124
125
|
}],
|
|
125
126
|
'site': {
|
|
127
|
+
'domain': 'dev.sparteo.com',
|
|
126
128
|
'publisher': {
|
|
127
129
|
'ext': {
|
|
128
130
|
'params': {
|
|
@@ -186,6 +188,7 @@ const VALID_REQUEST = {
|
|
|
186
188
|
}
|
|
187
189
|
}],
|
|
188
190
|
'site': {
|
|
191
|
+
'domain': 'dev.sparteo.com',
|
|
189
192
|
'publisher': {
|
|
190
193
|
'ext': {
|
|
191
194
|
'params': {
|
|
@@ -199,17 +202,26 @@ const VALID_REQUEST = {
|
|
|
199
202
|
}
|
|
200
203
|
};
|
|
201
204
|
|
|
205
|
+
const ORTB2_GLOBAL = {
|
|
206
|
+
site: {
|
|
207
|
+
domain: 'dev.sparteo.com'
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
202
211
|
const BIDDER_REQUEST = {
|
|
203
|
-
bids: [VALID_BID_BANNER, VALID_BID_VIDEO]
|
|
204
|
-
|
|
212
|
+
bids: [VALID_BID_BANNER, VALID_BID_VIDEO],
|
|
213
|
+
ortb2: ORTB2_GLOBAL
|
|
214
|
+
};
|
|
205
215
|
|
|
206
216
|
const BIDDER_REQUEST_BANNER = {
|
|
207
|
-
bids: [VALID_BID_BANNER]
|
|
208
|
-
|
|
217
|
+
bids: [VALID_BID_BANNER],
|
|
218
|
+
ortb2: ORTB2_GLOBAL
|
|
219
|
+
};
|
|
209
220
|
|
|
210
221
|
const BIDDER_REQUEST_VIDEO = {
|
|
211
|
-
bids: [VALID_BID_VIDEO]
|
|
212
|
-
|
|
222
|
+
bids: [VALID_BID_VIDEO],
|
|
223
|
+
ortb2: ORTB2_GLOBAL
|
|
224
|
+
};
|
|
213
225
|
|
|
214
226
|
describe('SparteoAdapter', function () {
|
|
215
227
|
describe('isBidRequestValid', function () {
|
|
@@ -250,55 +262,50 @@ describe('SparteoAdapter', function () {
|
|
|
250
262
|
|
|
251
263
|
describe('buildRequests', function () {
|
|
252
264
|
describe('Check method return', function () {
|
|
265
|
+
it('should return the right formatted banner requests', function () {
|
|
266
|
+
const request = adapter.buildRequests([VALID_BID_BANNER], BIDDER_REQUEST_BANNER);
|
|
267
|
+
delete request.data.id;
|
|
268
|
+
|
|
269
|
+
expect(request).to.deep.equal(VALID_REQUEST_BANNER);
|
|
270
|
+
});
|
|
253
271
|
if (FEATURES.VIDEO) {
|
|
254
|
-
it('should return the right formatted requests', function() {
|
|
272
|
+
it('should return the right formatted requests', function () {
|
|
255
273
|
const request = adapter.buildRequests([VALID_BID_BANNER, VALID_BID_VIDEO], BIDDER_REQUEST);
|
|
256
274
|
delete request.data.id;
|
|
257
275
|
|
|
258
276
|
expect(request).to.deep.equal(VALID_REQUEST);
|
|
259
277
|
});
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
it('should return the right formatted banner requests', function() {
|
|
263
|
-
const request = adapter.buildRequests([VALID_BID_BANNER], BIDDER_REQUEST_BANNER);
|
|
264
|
-
delete request.data.id;
|
|
265
278
|
|
|
266
|
-
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
if (FEATURES.VIDEO) {
|
|
270
|
-
it('should return the right formatted video requests', function() {
|
|
279
|
+
it('should return the right formatted video requests', function () {
|
|
271
280
|
const request = adapter.buildRequests([VALID_BID_VIDEO], BIDDER_REQUEST_VIDEO);
|
|
272
281
|
delete request.data.id;
|
|
273
282
|
|
|
274
283
|
expect(request).to.deep.equal(VALID_REQUEST_VIDEO);
|
|
275
284
|
});
|
|
276
|
-
}
|
|
277
285
|
|
|
278
|
-
|
|
279
|
-
|
|
286
|
+
it('should return the right formatted request with endpoint test', function () {
|
|
287
|
+
const endpoint = 'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=dev.sparteo.com';
|
|
280
288
|
|
|
281
|
-
|
|
282
|
-
params
|
|
283
|
-
endpoint: endpoint
|
|
284
|
-
}
|
|
285
|
-
});
|
|
289
|
+
const bids = deepClone([VALID_BID_BANNER, VALID_BID_VIDEO]);
|
|
290
|
+
bids[0].params.endpoint = endpoint;
|
|
286
291
|
|
|
287
|
-
|
|
292
|
+
const expectedRequest = deepClone(VALID_REQUEST);
|
|
293
|
+
expectedRequest.url = endpoint;
|
|
294
|
+
expectedRequest.data.imp[0].ext.sparteo.params.endpoint = endpoint;
|
|
288
295
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
delete request.data.id;
|
|
296
|
+
const request = adapter.buildRequests(bids, BIDDER_REQUEST);
|
|
297
|
+
delete request.data.id;
|
|
292
298
|
|
|
293
|
-
|
|
294
|
-
|
|
299
|
+
expect(request).to.deep.equal(expectedRequest);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
295
302
|
});
|
|
296
303
|
});
|
|
297
304
|
|
|
298
|
-
describe('interpretResponse', function() {
|
|
305
|
+
describe('interpretResponse', function () {
|
|
299
306
|
describe('Check method return', function () {
|
|
300
|
-
it('should return the right formatted response', function() {
|
|
301
|
-
|
|
307
|
+
it('should return the right formatted response', function () {
|
|
308
|
+
const response = {
|
|
302
309
|
body: {
|
|
303
310
|
'id': '63f4d300-6896-4bdc-8561-0932f73148b1',
|
|
304
311
|
'cur': 'EUR',
|
|
@@ -399,13 +406,69 @@ describe('SparteoAdapter', function () {
|
|
|
399
406
|
expect(adapter.interpretResponse(response, request)).to.deep.equal(formattedReponse);
|
|
400
407
|
}
|
|
401
408
|
});
|
|
409
|
+
|
|
410
|
+
if (FEATURES.VIDEO) {
|
|
411
|
+
it('should interprete renderer config', function () {
|
|
412
|
+
let response = {
|
|
413
|
+
body: {
|
|
414
|
+
'id': '63f4d300-6896-4bdc-8561-0932f73148b1',
|
|
415
|
+
'cur': 'EUR',
|
|
416
|
+
'seatbid': [
|
|
417
|
+
{
|
|
418
|
+
'seat': 'sparteo',
|
|
419
|
+
'group': 0,
|
|
420
|
+
'bid': [
|
|
421
|
+
{
|
|
422
|
+
'id': 'cdbb6982-a269-40c7-84e5-04797f11d87b',
|
|
423
|
+
'impid': '5e6f7g8h',
|
|
424
|
+
'price': 5,
|
|
425
|
+
'ext': {
|
|
426
|
+
'prebid': {
|
|
427
|
+
'type': 'video',
|
|
428
|
+
'cache': {
|
|
429
|
+
'vastXml': {
|
|
430
|
+
'url': 'https://pbs.tet.com/cache?uuid=1234'
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
'renderer': {
|
|
434
|
+
'url': 'testVideoPlayer.js',
|
|
435
|
+
'options': {
|
|
436
|
+
'disableTopBar': true,
|
|
437
|
+
'showBigPlayButton': false,
|
|
438
|
+
'showProgressBar': 'bar',
|
|
439
|
+
'showVolume': false,
|
|
440
|
+
'showMute': true,
|
|
441
|
+
'allowFullscreen': true
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
'adm': 'tag',
|
|
447
|
+
'crid': 'crid',
|
|
448
|
+
'w': 640,
|
|
449
|
+
'h': 480,
|
|
450
|
+
'nurl': 'https://t.bidder.sparteo.com/img'
|
|
451
|
+
}
|
|
452
|
+
]
|
|
453
|
+
}
|
|
454
|
+
]
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
const request = adapter.buildRequests([VALID_BID_BANNER, VALID_BID_VIDEO], BIDDER_REQUEST);
|
|
459
|
+
let formattedReponse = adapter.interpretResponse(response, request);
|
|
460
|
+
|
|
461
|
+
expect(formattedReponse[0].renderer.url).to.equal(response.body.seatbid[0].bid[0].ext.prebid.renderer.url);
|
|
462
|
+
expect(formattedReponse[0].renderer.config).to.deep.equal(response.body.seatbid[0].bid[0].ext.prebid.renderer);
|
|
463
|
+
});
|
|
464
|
+
}
|
|
402
465
|
});
|
|
403
466
|
});
|
|
404
467
|
|
|
405
|
-
describe('onBidWon', function() {
|
|
468
|
+
describe('onBidWon', function () {
|
|
406
469
|
describe('Check methods succeed', function () {
|
|
407
|
-
it('should not throw error', function() {
|
|
408
|
-
|
|
470
|
+
it('should not throw error', function () {
|
|
471
|
+
const bids = [
|
|
409
472
|
{
|
|
410
473
|
requestId: '1a2b3c4d',
|
|
411
474
|
seatBidId: 'cdbb6982-a269-40c7-84e5-04797f11d87a',
|
|
@@ -444,16 +507,16 @@ describe('SparteoAdapter', function () {
|
|
|
444
507
|
}
|
|
445
508
|
];
|
|
446
509
|
|
|
447
|
-
bids.forEach(function(bid) {
|
|
510
|
+
bids.forEach(function (bid) {
|
|
448
511
|
expect(adapter.onBidWon.bind(adapter, bid)).to.not.throw();
|
|
449
512
|
});
|
|
450
513
|
});
|
|
451
514
|
});
|
|
452
515
|
});
|
|
453
516
|
|
|
454
|
-
describe('getUserSyncs', function() {
|
|
517
|
+
describe('getUserSyncs', function () {
|
|
455
518
|
describe('Check methods succeed', function () {
|
|
456
|
-
it('should return the sync url', function() {
|
|
519
|
+
it('should return the sync url', function () {
|
|
457
520
|
const syncOptions = {
|
|
458
521
|
'iframeEnabled': true,
|
|
459
522
|
'pixelEnabled': false
|
|
@@ -475,4 +538,426 @@ describe('SparteoAdapter', function () {
|
|
|
475
538
|
});
|
|
476
539
|
});
|
|
477
540
|
});
|
|
541
|
+
|
|
542
|
+
describe('replaceMacros via buildRequests', function () {
|
|
543
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${SITE_DOMAIN_QUERY}${APP_DOMAIN_QUERY}${BUNDLE_QUERY}';
|
|
544
|
+
|
|
545
|
+
it('replaces macros for site traffic (site_domain only)', function () {
|
|
546
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
547
|
+
bid.params.endpoint = ENDPOINT;
|
|
548
|
+
bid.params.networkId = '1234567a-eb1b-1fae-1d23-e1fbaef234cf';
|
|
549
|
+
|
|
550
|
+
const bidderReq = {
|
|
551
|
+
bids: [bid],
|
|
552
|
+
ortb2: {
|
|
553
|
+
site: {
|
|
554
|
+
domain: 'site.sparteo.com',
|
|
555
|
+
publisher: { domain: 'dev.sparteo.com' }
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
561
|
+
delete req.data.id;
|
|
562
|
+
|
|
563
|
+
expect(req.url).to.equal(
|
|
564
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=site.sparteo.com'
|
|
565
|
+
);
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
it('uses site.page hostname when site.domain is missing', function () {
|
|
569
|
+
const ENDPOINT2 = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${SITE_DOMAIN_QUERY}';
|
|
570
|
+
|
|
571
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
572
|
+
bid.params.endpoint = ENDPOINT2;
|
|
573
|
+
bid.params.networkId = '1234567a-eb1b-1fae-1d23-e1fbaef234cf';
|
|
574
|
+
|
|
575
|
+
const bidderReq = {
|
|
576
|
+
bids: [bid],
|
|
577
|
+
ortb2: {
|
|
578
|
+
site: {
|
|
579
|
+
page: 'https://www.dev.sparteo.com:3000/p/some?x=1'
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
585
|
+
delete req.data.id;
|
|
586
|
+
|
|
587
|
+
expect(req.url).to.equal(
|
|
588
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=dev.sparteo.com'
|
|
589
|
+
);
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
it('omits domain query and leaves network_id empty when neither site nor app is present', function () {
|
|
593
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
594
|
+
bid.params.endpoint = ENDPOINT;
|
|
595
|
+
bid.params.networkId = '1234567a-eb1b-1fae-1d23-e1fbaef234cf';
|
|
596
|
+
|
|
597
|
+
const bidderReq = { bids: [bid], ortb2: {} };
|
|
598
|
+
|
|
599
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
600
|
+
delete req.data.id;
|
|
601
|
+
|
|
602
|
+
expect(req.url).to.equal(
|
|
603
|
+
'https://bid.sparteo.com/auction?network_id='
|
|
604
|
+
);
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
it('sets site_domain=unknown when site.domain is null', function () {
|
|
608
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
609
|
+
bid.params.endpoint = ENDPOINT;
|
|
610
|
+
|
|
611
|
+
const bidderReq = {
|
|
612
|
+
bids: [bid],
|
|
613
|
+
ortb2: {
|
|
614
|
+
site: {
|
|
615
|
+
domain: null
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
621
|
+
delete req.data.id;
|
|
622
|
+
|
|
623
|
+
expect(req.url).to.equal(
|
|
624
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=unknown'
|
|
625
|
+
);
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
it('replaces ${NETWORK_ID} with empty when undefined', function () {
|
|
629
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
630
|
+
bid.params.endpoint = ENDPOINT;
|
|
631
|
+
delete bid.params.networkId;
|
|
632
|
+
|
|
633
|
+
const bidderReq = {
|
|
634
|
+
bids: [bid],
|
|
635
|
+
ortb2: {
|
|
636
|
+
site: {
|
|
637
|
+
domain: 'dev.sparteo.com'
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
643
|
+
delete req.data.id;
|
|
644
|
+
|
|
645
|
+
expect(req.url).to.equal(
|
|
646
|
+
'https://bid.sparteo.com/auction?network_id=&site_domain=dev.sparteo.com'
|
|
647
|
+
);
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
it('replaces ${NETWORK_ID} with empty when null', function () {
|
|
651
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
652
|
+
bid.params.endpoint = ENDPOINT;
|
|
653
|
+
bid.params.networkId = null;
|
|
654
|
+
|
|
655
|
+
const bidderReq = {
|
|
656
|
+
bids: [bid],
|
|
657
|
+
ortb2: {
|
|
658
|
+
site: {
|
|
659
|
+
domain: 'dev.sparteo.com'
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
665
|
+
delete req.data.id;
|
|
666
|
+
|
|
667
|
+
expect(req.url).to.equal(
|
|
668
|
+
'https://bid.sparteo.com/auction?network_id=&site_domain=dev.sparteo.com'
|
|
669
|
+
);
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
it('appends &bundle=... and uses app_domain when app.bundle is present', function () {
|
|
673
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
674
|
+
bid.params.endpoint = ENDPOINT;
|
|
675
|
+
|
|
676
|
+
const bidderReq = {
|
|
677
|
+
bids: [bid],
|
|
678
|
+
ortb2: {
|
|
679
|
+
app: {
|
|
680
|
+
domain: 'dev.sparteo.com',
|
|
681
|
+
bundle: 'com.sparteo.app'
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
687
|
+
delete req.data.id;
|
|
688
|
+
|
|
689
|
+
expect(req.url).to.equal(
|
|
690
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&app_domain=dev.sparteo.com&bundle=com.sparteo.app'
|
|
691
|
+
);
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
it('does not append &bundle when app is missing; uses site_domain when site exists', function () {
|
|
695
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
696
|
+
bid.params.endpoint = ENDPOINT;
|
|
697
|
+
|
|
698
|
+
const bidderReq = {
|
|
699
|
+
bids: [bid],
|
|
700
|
+
ortb2: {
|
|
701
|
+
site: { domain: 'dev.sparteo.com' }
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
706
|
+
delete req.data.id;
|
|
707
|
+
|
|
708
|
+
expect(req.url).to.equal(
|
|
709
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=dev.sparteo.com'
|
|
710
|
+
);
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
it('prefers site over app when both are present', function () {
|
|
714
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${SITE_DOMAIN_QUERY}${APP_DOMAIN_QUERY}${BUNDLE_QUERY}';
|
|
715
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
716
|
+
bid.params.endpoint = ENDPOINT;
|
|
717
|
+
|
|
718
|
+
const bidderReq = {
|
|
719
|
+
bids: [bid],
|
|
720
|
+
ortb2: {
|
|
721
|
+
site: { domain: 'site.sparteo.com' },
|
|
722
|
+
app: { domain: 'app.sparteo.com', bundle: 'com.sparteo.app' }
|
|
723
|
+
}
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
727
|
+
delete req.data.id;
|
|
728
|
+
|
|
729
|
+
expect(req.url).to.equal(
|
|
730
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=site.sparteo.com'
|
|
731
|
+
);
|
|
732
|
+
expect(req.data.site?.publisher?.ext?.params?.networkId).to.equal('1234567a-eb1b-1fae-1d23-e1fbaef234cf');
|
|
733
|
+
expect(req.data.app).to.be.undefined;
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
['', ' ', 'null', 'NuLl'].forEach((val) => {
|
|
737
|
+
it(`app bundle "${val}" produces &bundle=unknown`, function () {
|
|
738
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${APP_DOMAIN_QUERY}${BUNDLE_QUERY}';
|
|
739
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
740
|
+
bid.params.endpoint = ENDPOINT;
|
|
741
|
+
|
|
742
|
+
const bidderReq = {
|
|
743
|
+
bids: [bid],
|
|
744
|
+
ortb2: { app: { domain: 'dev.sparteo.com', bundle: val } }
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
748
|
+
delete req.data.id;
|
|
749
|
+
|
|
750
|
+
expect(req.url).to.equal(
|
|
751
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&app_domain=dev.sparteo.com&bundle=unknown'
|
|
752
|
+
);
|
|
753
|
+
});
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
it('app domain missing becomes app_domain=unknown while keeping bundle', function () {
|
|
757
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${APP_DOMAIN_QUERY}${BUNDLE_QUERY}';
|
|
758
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
759
|
+
bid.params.endpoint = ENDPOINT;
|
|
760
|
+
|
|
761
|
+
const bidderReq = {
|
|
762
|
+
bids: [bid],
|
|
763
|
+
ortb2: { app: { domain: '', bundle: 'com.sparteo.app' } }
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
767
|
+
delete req.data.id;
|
|
768
|
+
|
|
769
|
+
expect(req.url).to.equal(
|
|
770
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&app_domain=unknown&bundle=com.sparteo.app'
|
|
771
|
+
);
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
it('uses network_id from app.publisher.ext for app-only traffic', function () {
|
|
775
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${APP_DOMAIN_QUERY}${BUNDLE_QUERY}';
|
|
776
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
777
|
+
bid.params.endpoint = ENDPOINT;
|
|
778
|
+
|
|
779
|
+
const bidderReq = {
|
|
780
|
+
bids: [bid],
|
|
781
|
+
ortb2: { app: { domain: 'dev.sparteo.com', bundle: 'com.sparteo.app' } }
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
785
|
+
delete req.data.id;
|
|
786
|
+
|
|
787
|
+
expect(req.data.site).to.be.undefined;
|
|
788
|
+
expect(req.data.app?.publisher?.ext?.params?.networkId).to.equal('1234567a-eb1b-1fae-1d23-e1fbaef234cf');
|
|
789
|
+
expect(req.url).to.equal(
|
|
790
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&app_domain=dev.sparteo.com&bundle=com.sparteo.app'
|
|
791
|
+
);
|
|
792
|
+
});
|
|
793
|
+
|
|
794
|
+
it('unparsable site.page yields site_domain=unknown', function () {
|
|
795
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${SITE_DOMAIN_QUERY}';
|
|
796
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
797
|
+
bid.params.endpoint = ENDPOINT;
|
|
798
|
+
|
|
799
|
+
const bidderReq = {
|
|
800
|
+
bids: [bid],
|
|
801
|
+
ortb2: { site: { page: 'not a url' } }
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
805
|
+
delete req.data.id;
|
|
806
|
+
|
|
807
|
+
expect(req.url).to.equal(
|
|
808
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=unknown'
|
|
809
|
+
);
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
it('literal "null" in site.page yields site_domain=unknown', function () {
|
|
813
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${SITE_DOMAIN_QUERY}';
|
|
814
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
815
|
+
bid.params.endpoint = ENDPOINT;
|
|
816
|
+
|
|
817
|
+
const bidderReq = {
|
|
818
|
+
bids: [bid],
|
|
819
|
+
ortb2: { site: { domain: '', page: 'null' } }
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
823
|
+
delete req.data.id;
|
|
824
|
+
|
|
825
|
+
expect(req.url).to.equal(
|
|
826
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=unknown'
|
|
827
|
+
);
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
it('does not create site on app-only request', function () {
|
|
831
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${APP_DOMAIN_QUERY}${BUNDLE_QUERY}';
|
|
832
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
833
|
+
bid.params.endpoint = ENDPOINT;
|
|
834
|
+
|
|
835
|
+
const bidderReq = {
|
|
836
|
+
bids: [bid],
|
|
837
|
+
ortb2: { app: { domain: 'dev.sparteo.com', bundle: 'com.sparteo.app' } }
|
|
838
|
+
};
|
|
839
|
+
|
|
840
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
841
|
+
delete req.data.id;
|
|
842
|
+
|
|
843
|
+
expect(req.data.site).to.be.undefined;
|
|
844
|
+
expect(req.data.app).to.exist;
|
|
845
|
+
expect(req.url).to.equal(
|
|
846
|
+
'https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&app_domain=dev.sparteo.com&bundle=com.sparteo.app'
|
|
847
|
+
);
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
it('propagates adUnitCode into imp.ext.sparteo.params.adUnitCode', function () {
|
|
851
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${SITE_DOMAIN_QUERY}';
|
|
852
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
853
|
+
bid.params.endpoint = ENDPOINT;
|
|
854
|
+
|
|
855
|
+
const req = adapter.buildRequests([bid], { bids: [bid], ortb2: { site: { domain: 'dev.sparteo.com' } } });
|
|
856
|
+
delete req.data.id;
|
|
857
|
+
|
|
858
|
+
expect(req.data.imp[0]?.ext?.sparteo?.params?.adUnitCode).to.equal(bid.adUnitCode);
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
it('sets pbjsVersion and networkId under site root', function () {
|
|
862
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${SITE_DOMAIN_QUERY}';
|
|
863
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
864
|
+
bid.params.endpoint = ENDPOINT;
|
|
865
|
+
|
|
866
|
+
const bidderReq = { bids: [bid], ortb2: { site: { domain: 'dev.sparteo.com' } } };
|
|
867
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
868
|
+
delete req.data.id;
|
|
869
|
+
|
|
870
|
+
const params = req.data.site?.publisher?.ext?.params;
|
|
871
|
+
expect(params?.pbjsVersion).to.equal('$prebid.version$');
|
|
872
|
+
expect(params?.networkId).to.equal('1234567a-eb1b-1fae-1d23-e1fbaef234cf');
|
|
873
|
+
expect(req.data.app?.publisher?.ext?.params?.pbjsVersion).to.be.undefined;
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
it('sets pbjsVersion and networkId under app root', function () {
|
|
877
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${APP_DOMAIN_QUERY}${BUNDLE_QUERY}';
|
|
878
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
879
|
+
bid.params.endpoint = ENDPOINT;
|
|
880
|
+
|
|
881
|
+
const bidderReq = { bids: [bid], ortb2: { app: { domain: 'dev.sparteo.com', bundle: 'com.sparteo.app' } } };
|
|
882
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
883
|
+
delete req.data.id;
|
|
884
|
+
|
|
885
|
+
const params = req.data.app?.publisher?.ext?.params;
|
|
886
|
+
expect(params?.pbjsVersion).to.equal('$prebid.version$');
|
|
887
|
+
expect(params?.networkId).to.equal('1234567a-eb1b-1fae-1d23-e1fbaef234cf');
|
|
888
|
+
expect(req.data.site).to.be.undefined;
|
|
889
|
+
});
|
|
890
|
+
|
|
891
|
+
it('app-only without networkId leaves network_id empty', function () {
|
|
892
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${APP_DOMAIN_QUERY}${BUNDLE_QUERY}';
|
|
893
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
894
|
+
bid.params.endpoint = ENDPOINT;
|
|
895
|
+
delete bid.params.networkId;
|
|
896
|
+
|
|
897
|
+
const bidderReq = { bids: [bid], ortb2: { app: { domain: 'dev.sparteo.com', bundle: 'com.sparteo.app' } } };
|
|
898
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
899
|
+
delete req.data.id;
|
|
900
|
+
|
|
901
|
+
expect(req.url).to.equal(
|
|
902
|
+
'https://bid.sparteo.com/auction?network_id=&app_domain=dev.sparteo.com&bundle=com.sparteo.app'
|
|
903
|
+
);
|
|
904
|
+
});
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
describe('domain normalization (strip www., port, path, trim)', function () {
|
|
908
|
+
const ENDPOINT = 'https://bid.sparteo.com/auction?network_id=${NETWORK_ID}${SITE_DOMAIN_QUERY}';
|
|
909
|
+
|
|
910
|
+
const CASES = [
|
|
911
|
+
{
|
|
912
|
+
label: 'strips leading "www." from site.domain',
|
|
913
|
+
site: { domain: 'www.dev.sparteo.com' },
|
|
914
|
+
expected: 'dev.sparteo.com'
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
label: 'trims whitespace and strips "www."',
|
|
918
|
+
site: { domain: ' www.dev.sparteo.com ' },
|
|
919
|
+
expected: 'dev.sparteo.com'
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
label: 'preserves non-"www" prefixes like "www2."',
|
|
923
|
+
site: { domain: 'www2.dev.sparteo.com' },
|
|
924
|
+
expected: 'www2.dev.sparteo.com'
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
label: 'removes port from site.page',
|
|
928
|
+
site: { page: 'https://dev.sparteo.com:8080/path?q=1' },
|
|
929
|
+
expected: 'dev.sparteo.com'
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
label: 'removes "www." and path from site.page',
|
|
933
|
+
site: { page: 'http://www.dev.sparteo.com/p?q=1' },
|
|
934
|
+
expected: 'dev.sparteo.com'
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
label: 'removes port when it appears in site.domain',
|
|
938
|
+
site: { domain: 'dev.sparteo.com:8443' },
|
|
939
|
+
expected: 'dev.sparteo.com'
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
label: 'removes accidental path in site.domain',
|
|
943
|
+
site: { domain: 'dev.sparteo.com/some/path' },
|
|
944
|
+
expected: 'dev.sparteo.com'
|
|
945
|
+
}
|
|
946
|
+
];
|
|
947
|
+
|
|
948
|
+
CASES.forEach(({ label, site, expected }) => {
|
|
949
|
+
it(label, function () {
|
|
950
|
+
const bid = deepClone(VALID_BID_BANNER);
|
|
951
|
+
bid.params.endpoint = ENDPOINT;
|
|
952
|
+
const bidderReq = { bids: [bid], ortb2: { site } };
|
|
953
|
+
|
|
954
|
+
const req = adapter.buildRequests([bid], bidderReq);
|
|
955
|
+
delete req.data.id;
|
|
956
|
+
|
|
957
|
+
expect(req.url).to.equal(
|
|
958
|
+
`https://bid.sparteo.com/auction?network_id=1234567a-eb1b-1fae-1d23-e1fbaef234cf&site_domain=${expected}`
|
|
959
|
+
);
|
|
960
|
+
});
|
|
961
|
+
});
|
|
962
|
+
});
|
|
478
963
|
});
|