prebid.js 8.45.0 → 8.46.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/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/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adnuntiusBidAdapter.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/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/agmaAnalyticsAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.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/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/dependencies.json +12 -3
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/engageyaBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.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/id5IdSystem.js +1 -1
- package/dist/illuminBidAdapter.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerBidAdapter.js +1 -0
- 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/kueezRtbBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +154 -152
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openwebBidAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optableBidAdapter.js +1 -0
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/ortbConverter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/publirBidAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.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/riseBidAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/shinezRtbBidAdapter.js +1 -1
- package/dist/sirdataRtdProvider.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/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stnBidAdapter.js +1 -1
- package/dist/stroeerCoreBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tagorasBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/themoneytizerBidAdapter.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/viantOrtbBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yandexAnalyticsAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/noadserver/jwplayerBidAdapter_sample.html +75 -0
- package/integrationExamples/realTimeData/jwplayerRtdProvider_example.html +7 -0
- package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +7 -0
- package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +9 -4
- package/integrationExamples/videoModule/jwplayer/bidsBackHandlerOverride.html +7 -0
- package/integrationExamples/videoModule/jwplayer/eventListeners.html +7 -0
- package/integrationExamples/videoModule/jwplayer/eventsUI.html +7 -0
- package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +7 -0
- package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +7 -0
- package/integrationExamples/videoModule/jwplayer/playlist.html +7 -0
- package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +7 -0
- package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +7 -0
- package/integrationExamples/videoModule/videojs/bidsBackHandlerOverride.html +7 -0
- package/integrationExamples/videoModule/videojs/eventListeners.html +7 -0
- package/integrationExamples/videoModule/videojs/eventsUI.html +7 -0
- package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +7 -0
- package/integrationExamples/videoModule/videojs/mediaMetadata.html +7 -0
- package/integrationExamples/videoModule/videojs/playlist.html +7 -0
- package/libraries/ortbConverter/processors/banner.js +2 -2
- package/modules/adgenerationBidAdapter.js +6 -10
- package/modules/adnuntiusBidAdapter.js +5 -0
- package/modules/alkimiBidAdapter.js +48 -8
- package/modules/engageyaBidAdapter.js +1 -1
- package/modules/gumgumBidAdapter.js +1 -1
- package/modules/jwplayerBidAdapter.js +412 -0
- package/modules/jwplayerBidAdapter.md +72 -0
- package/modules/optableBidAdapter.js +42 -0
- package/modules/optableBidAdapter.md +41 -0
- package/modules/optidigitalBidAdapter.js +20 -4
- package/modules/pubmaticBidAdapter.js +21 -1
- package/modules/relaidoBidAdapter.js +70 -9
- package/modules/sirdataRtdProvider.js +33 -43
- package/modules/stroeerCoreBidAdapter.js +7 -5
- package/modules/viantOrtbBidAdapter.js +2 -0
- package/modules/yandexAnalyticsAdapter.js +6 -0
- package/package.json +1 -1
- package/src/utils.js +15 -2
- package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +18 -1
- package/test/spec/modules/alkimiBidAdapter_spec.js +11 -5
- package/test/spec/modules/gumgumBidAdapter_spec.js +1 -1
- package/test/spec/modules/jwplayerBidAdapter_spec.js +412 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +13 -15
- package/test/spec/modules/optableBidAdapter_spec.js +89 -0
- package/test/spec/modules/optidigitalBidAdapter_spec.js +34 -4
- package/test/spec/modules/pubmaticBidAdapter_spec.js +24 -1
- package/test/spec/modules/relaidoBidAdapter_spec.js +62 -0
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +21 -0
- package/test/spec/utils_spec.js +17 -1
|
@@ -423,7 +423,32 @@ describe('optidigitalAdapterTests', function () {
|
|
|
423
423
|
bidderRequest.uspConsent = '1YYY';
|
|
424
424
|
const request = spec.buildRequests(validBidRequests, bidderRequest);
|
|
425
425
|
const payload = JSON.parse(request.data);
|
|
426
|
-
expect(payload.
|
|
426
|
+
expect(payload.us_privacy).to.exist;
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
it('should send gppConsent to given endpoint where there is gppConsent', function() {
|
|
430
|
+
let consentString = 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==';
|
|
431
|
+
bidderRequest.gppConsent = {
|
|
432
|
+
'gppString': consentString,
|
|
433
|
+
'applicableSections': [7]
|
|
434
|
+
};
|
|
435
|
+
const request = spec.buildRequests(validBidRequests, bidderRequest);
|
|
436
|
+
const payload = JSON.parse(request.data);
|
|
437
|
+
expect(payload.gpp).to.exist;
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
it('should send gppConsent to given endpoint when there is gpp in ortb2', function() {
|
|
441
|
+
let consentString = 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==';
|
|
442
|
+
bidderRequest.gppConsent = undefined;
|
|
443
|
+
bidderRequest.ortb2 = {
|
|
444
|
+
regs: {
|
|
445
|
+
gpp: consentString,
|
|
446
|
+
gpp_sid: [7]
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
const request = spec.buildRequests(validBidRequests, bidderRequest);
|
|
450
|
+
const payload = JSON.parse(request.data);
|
|
451
|
+
expect(payload.gpp).to.exist;
|
|
427
452
|
});
|
|
428
453
|
|
|
429
454
|
it('should use appropriate mediaTypes banner sizes', function() {
|
|
@@ -546,9 +571,14 @@ describe('optidigitalAdapterTests', function () {
|
|
|
546
571
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=`
|
|
547
572
|
}]);
|
|
548
573
|
});
|
|
549
|
-
it('should return appropriate URL with GDPR equals to 1, GDPR consent and
|
|
550
|
-
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'},
|
|
551
|
-
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&
|
|
574
|
+
it('should return appropriate URL with GDPR equals to 1, GDPR consent and US Privacy consent', function() {
|
|
575
|
+
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, 'fooUsp')).to.deep.equal([{
|
|
576
|
+
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&us_privacy=fooUsp`
|
|
577
|
+
}]);
|
|
578
|
+
});
|
|
579
|
+
it('should return appropriate URL with GDPR equals to 1, GDPR consent, US Privacy consent and GPP consent', function() {
|
|
580
|
+
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, 'fooUsp', {gppString: 'fooGpp', applicableSections: [7]})).to.deep.equal([{
|
|
581
|
+
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&us_privacy=fooUsp&gpp=fooGpp&gpp_sid=7`
|
|
552
582
|
}]);
|
|
553
583
|
});
|
|
554
584
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { spec, checkVideoPlacement, _getDomainFromURL, assignDealTier, prepareMetaObject } from 'modules/pubmaticBidAdapter.js';
|
|
2
|
+
import { spec, checkVideoPlacement, _getDomainFromURL, assignDealTier, prepareMetaObject, getDeviceConnectionType } from 'modules/pubmaticBidAdapter.js';
|
|
3
3
|
import * as utils from 'src/utils.js';
|
|
4
4
|
import { config } from 'src/config.js';
|
|
5
5
|
import { createEidsArray } from 'modules/userId/eids.js';
|
|
@@ -2964,6 +2964,14 @@ describe('PubMatic adapter', function () {
|
|
|
2964
2964
|
expect(data.imp[0].ext.ae).to.equal(1);
|
|
2965
2965
|
});
|
|
2966
2966
|
});
|
|
2967
|
+
|
|
2968
|
+
it('should send connectiontype parameter if browser contains navigator.connection property', function () {
|
|
2969
|
+
const bidRequest = spec.buildRequests(bidRequests);
|
|
2970
|
+
let data = JSON.parse(bidRequest.data);
|
|
2971
|
+
if (window.navigator && window.navigator.connection) {
|
|
2972
|
+
expect(data.device).to.include.any.keys('connectiontype');
|
|
2973
|
+
}
|
|
2974
|
+
});
|
|
2967
2975
|
});
|
|
2968
2976
|
|
|
2969
2977
|
it('Request params dctr check', function () {
|
|
@@ -4020,6 +4028,21 @@ describe('PubMatic adapter', function () {
|
|
|
4020
4028
|
});
|
|
4021
4029
|
});
|
|
4022
4030
|
|
|
4031
|
+
describe('getDeviceConnectionType', function() {
|
|
4032
|
+
it('is a function', function(done) {
|
|
4033
|
+
getDeviceConnectionType.should.be.a('function');
|
|
4034
|
+
done();
|
|
4035
|
+
});
|
|
4036
|
+
|
|
4037
|
+
it('should return matched value if navigator.connection is present', function(done) {
|
|
4038
|
+
const connectionValue = getDeviceConnectionType();
|
|
4039
|
+
if (window?.navigator?.connection) {
|
|
4040
|
+
expect(connectionValue).to.be.a('number');
|
|
4041
|
+
}
|
|
4042
|
+
done();
|
|
4043
|
+
});
|
|
4044
|
+
});
|
|
4045
|
+
|
|
4023
4046
|
if (FEATURES.VIDEO) {
|
|
4024
4047
|
describe('Checking for Video.Placement property', function() {
|
|
4025
4048
|
let sandbox, utilsMock;
|
|
@@ -3,6 +3,7 @@ import {spec} from 'modules/relaidoBidAdapter.js';
|
|
|
3
3
|
import * as utils from 'src/utils.js';
|
|
4
4
|
import {VIDEO} from 'src/mediaTypes.js';
|
|
5
5
|
import {getCoreStorageManager} from '../../../src/storageManager.js';
|
|
6
|
+
import * as mockGpt from '../integration/faker/googletag.js';
|
|
6
7
|
|
|
7
8
|
const UUID_KEY = 'relaido_uuid';
|
|
8
9
|
const relaido_uuid = 'hogehoge';
|
|
@@ -15,14 +16,18 @@ describe('RelaidoAdapter', function () {
|
|
|
15
16
|
let serverRequest;
|
|
16
17
|
let generateUUIDStub;
|
|
17
18
|
let triggerPixelStub;
|
|
19
|
+
let sandbox;
|
|
20
|
+
|
|
18
21
|
before(() => {
|
|
19
22
|
const storage = getCoreStorageManager();
|
|
20
23
|
storage.setCookie(UUID_KEY, relaido_uuid);
|
|
21
24
|
});
|
|
22
25
|
|
|
23
26
|
beforeEach(function () {
|
|
27
|
+
mockGpt.disable();
|
|
24
28
|
generateUUIDStub = sinon.stub(utils, 'generateUUID').returns(relaido_uuid);
|
|
25
29
|
triggerPixelStub = sinon.stub(utils, 'triggerPixel');
|
|
30
|
+
sandbox = sinon.sandbox.create();
|
|
26
31
|
bidRequest = {
|
|
27
32
|
bidder: 'relaido',
|
|
28
33
|
params: {
|
|
@@ -115,6 +120,7 @@ describe('RelaidoAdapter', function () {
|
|
|
115
120
|
afterEach(() => {
|
|
116
121
|
generateUUIDStub.restore();
|
|
117
122
|
triggerPixelStub.restore();
|
|
123
|
+
sandbox.restore();
|
|
118
124
|
});
|
|
119
125
|
|
|
120
126
|
describe('spec.isBidRequestValid', function () {
|
|
@@ -251,8 +257,10 @@ describe('RelaidoAdapter', function () {
|
|
|
251
257
|
expect(request.bid_id).to.equal(bidRequest.bidId);
|
|
252
258
|
expect(request.transaction_id).to.equal(bidRequest.ortb2Imp.ext.tid);
|
|
253
259
|
expect(request.media_type).to.equal('video');
|
|
260
|
+
expect(request.pagekvt).to.deep.equal({});
|
|
254
261
|
expect(data.uuid).to.equal(relaido_uuid);
|
|
255
262
|
expect(data.pv).to.equal('$prebid.version$');
|
|
263
|
+
expect(request.userIdAsEids).to.be.an('array');
|
|
256
264
|
});
|
|
257
265
|
|
|
258
266
|
it('should build bid requests by banner', function () {
|
|
@@ -335,6 +343,60 @@ describe('RelaidoAdapter', function () {
|
|
|
335
343
|
expect(data.bids[0].userIdAsEids).to.have.lengthOf(1);
|
|
336
344
|
expect(data.bids[0].userIdAsEids[0].source).to.equal('hogehoge.com');
|
|
337
345
|
});
|
|
346
|
+
|
|
347
|
+
it('should get pagekvt', function () {
|
|
348
|
+
mockGpt.enable();
|
|
349
|
+
window.googletag.pubads().clearTargeting();
|
|
350
|
+
window.googletag.pubads().setTargeting('testkey', ['testvalue']);
|
|
351
|
+
bidRequest.adUnitCode = 'test-adunit-code-1';
|
|
352
|
+
window.googletag.pubads().setSlots([mockGpt.makeSlot({ code: bidRequest.adUnitCode })]);
|
|
353
|
+
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
354
|
+
const data = JSON.parse(bidRequests.data);
|
|
355
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
356
|
+
const request = data.bids[0];
|
|
357
|
+
expect(request.pagekvt).to.deep.equal({testkey: ['testvalue']});
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
it('should get canonicalUrl (ogUrl:true)', function () {
|
|
361
|
+
bidRequest.params.ogUrl = true;
|
|
362
|
+
bidderRequest.refererInfo.canonicalUrl = null;
|
|
363
|
+
let documentStub = sandbox.stub(window.top.document, 'querySelector');
|
|
364
|
+
documentStub.withArgs('meta[property="og:url"]').returns({
|
|
365
|
+
content: 'http://localhost:9999/fb-test'
|
|
366
|
+
});
|
|
367
|
+
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
368
|
+
const data = JSON.parse(bidRequests.data);
|
|
369
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
370
|
+
expect(data.canonical_url).to.equal('http://localhost:9999/fb-test');
|
|
371
|
+
expect(data.canonical_url_hash).to.equal('cd106829f866d60ee4ed43c6e2a5d0a5212ffc97');
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
it('should not get canonicalUrl (ogUrl:false)', function () {
|
|
375
|
+
bidRequest.params.ogUrl = false;
|
|
376
|
+
bidderRequest.refererInfo.canonicalUrl = null;
|
|
377
|
+
let documentStub = sandbox.stub(window.top.document, 'querySelector');
|
|
378
|
+
documentStub.withArgs('meta[property="og:url"]').returns({
|
|
379
|
+
content: 'http://localhost:9999/fb-test'
|
|
380
|
+
});
|
|
381
|
+
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
382
|
+
const data = JSON.parse(bidRequests.data);
|
|
383
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
384
|
+
expect(data.canonical_url).to.be.null;
|
|
385
|
+
expect(data.canonical_url_hash).to.be.null;
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
it('should not get canonicalUrl (ogUrl:nothing)', function () {
|
|
389
|
+
bidderRequest.refererInfo.canonicalUrl = null;
|
|
390
|
+
let documentStub = sandbox.stub(window.top.document, 'querySelector');
|
|
391
|
+
documentStub.withArgs('meta[property="og:url"]').returns({
|
|
392
|
+
content: 'http://localhost:9999/fb-test'
|
|
393
|
+
});
|
|
394
|
+
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
395
|
+
const data = JSON.parse(bidRequests.data);
|
|
396
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
397
|
+
expect(data.canonical_url).to.be.null;
|
|
398
|
+
expect(data.canonical_url_hash).to.be.null;
|
|
399
|
+
});
|
|
338
400
|
});
|
|
339
401
|
|
|
340
402
|
describe('spec.interpretResponse', function () {
|
|
@@ -877,6 +877,27 @@ describe('stroeerCore bid adapter', function () {
|
|
|
877
877
|
|
|
878
878
|
assert.deepEqual(sentOrtb2, ortb2);
|
|
879
879
|
});
|
|
880
|
+
|
|
881
|
+
it('should add the Cookie Deprecation Label', () => {
|
|
882
|
+
const bidReq = buildBidderRequest();
|
|
883
|
+
|
|
884
|
+
const cDepObj = {
|
|
885
|
+
cdep: 'example_label_1'
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
const ortb2 = {
|
|
889
|
+
device: {
|
|
890
|
+
ext: cDepObj
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
bidReq.ortb2 = utils.deepClone(ortb2);
|
|
895
|
+
|
|
896
|
+
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq);
|
|
897
|
+
const sentOrtb2 = serverRequestInfo.data.ortb2;
|
|
898
|
+
|
|
899
|
+
assert.deepEqual(sentOrtb2, ortb2);
|
|
900
|
+
});
|
|
880
901
|
});
|
|
881
902
|
});
|
|
882
903
|
});
|
package/test/spec/utils_spec.js
CHANGED
|
@@ -3,7 +3,7 @@ import {expect} from 'chai';
|
|
|
3
3
|
import { TARGETING_KEYS } from 'src/constants.js';
|
|
4
4
|
import * as utils from 'src/utils.js';
|
|
5
5
|
import {getHighestCpm, getLatestHighestCpmBid, getOldestHighestCpmBid} from '../../src/utils/reducers.js';
|
|
6
|
-
import {binarySearch, deepEqual, memoize, waitForElementToLoad} from 'src/utils.js';
|
|
6
|
+
import {binarySearch, deepEqual, encodeMacroURI, memoize, waitForElementToLoad} from 'src/utils.js';
|
|
7
7
|
import {convertCamelToUnderscore} from '../../libraries/appnexusUtils/anUtils.js';
|
|
8
8
|
|
|
9
9
|
var assert = require('assert');
|
|
@@ -778,6 +778,22 @@ describe('Utils', function () {
|
|
|
778
778
|
expect(parsed.search).to.equal('?search=test&foo=bar&bar=foo&foo=xxx');
|
|
779
779
|
});
|
|
780
780
|
});
|
|
781
|
+
|
|
782
|
+
describe('encodeMacroURI', () => {
|
|
783
|
+
[
|
|
784
|
+
['https://www.example.com', 'https://www.example.com'],
|
|
785
|
+
['https://www.example/${MACRO}', 'https://www.example/${MACRO}'],
|
|
786
|
+
['http://www.example/è', `http://www.example/${encodeURIComponent('è')}`],
|
|
787
|
+
['https://www.${MACRO_1}/${MACRO_1}/${MACRO_2}è', 'https://www.${MACRO_1}/${MACRO_1}/${MACRO_2}' + encodeURIComponent('è')],
|
|
788
|
+
['http://${MACRO}${MACRO}/${MACRO}', 'http://${MACRO}${MACRO}/${MACRO}'],
|
|
789
|
+
['{MACRO}${MACRO}', `${encodeURIComponent('{MACRO}')}\${MACRO}`],
|
|
790
|
+
['https://www.example.com?p=${AUCTION_PRICE}', 'https://www.example.com?p=${AUCTION_PRICE}']
|
|
791
|
+
].forEach(([input, expected]) => {
|
|
792
|
+
it(`can encode ${input} -> ${expected}`, () => {
|
|
793
|
+
expect(encodeMacroURI(input)).to.eql(expected);
|
|
794
|
+
})
|
|
795
|
+
})
|
|
796
|
+
})
|
|
781
797
|
});
|
|
782
798
|
|
|
783
799
|
describe('insertElement', function () {
|