prebid.js 8.7.0 → 8.9.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/1plusXRtdProvider.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/a1MediaRtdProvider.js +1 -1
- package/dist/adWMGAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
- package/dist/adlooxAdServerVideo.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/admaticBidAdapter.js +1 -1
- package/dist/admixerIdSystem.js +1 -1
- package/dist/adnuntiusRtdProvider.js +1 -1
- package/dist/adpartnerBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adqueryIdSystem.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtelligentIdSystem.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adxpremiumAnalyticsAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/aidemBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/akamaiDapRtdProvider.js +1 -1
- package/dist/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/analyticsAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/atsAnalyticsAdapter.js +1 -1
- package/dist/automatadBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidViewability.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/brightcomSSPBidAdapter.js +1 -1
- package/dist/britepoolIdSystem.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/byDataAnalyticsAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/categoryTranslation.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/colossussspBidAdapter.js +1 -1
- package/dist/concertAnalyticsAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.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/criteoIdSystem.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dacIdSystem.js +1 -1
- package/dist/dailyhuntBidAdapter.js +1 -1
- package/dist/datablocksBidAdapter.js +1 -1
- package/dist/dependencies.json +4 -1
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dmdIdSystem.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningAnalyticsAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/fabrickIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fintezaAnalyticsAdapter.js +1 -1
- package/dist/fledgeForGpt.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/genericAnalyticsAdapter.js +1 -1
- package/dist/geoedgeRtdProvider.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/gnetBidAdapter.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/growthCodeAnalyticsAdapter.js +1 -1
- package/dist/growthCodeIdSystem.js +1 -1
- package/dist/growthCodeRtdProvider.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hadronAnalyticsAdapter.js +1 -1
- package/dist/hadronIdSystem.js +1 -1
- package/dist/hadronRtdProvider.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/iasRtdProvider.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/idImportLibrary.js +1 -1
- package/dist/identityLinkIdSystem.js +1 -1
- package/dist/imRtdProvider.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/imuIdSystem.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqIdSystem.js +1 -1
- package/dist/invisiblyAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerRtdProvider.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kinessoIdSystem.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/konduitWrapper.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveIntentAnalyticsAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/livewrappedAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/lotamePanoramaIdSystem.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/mantisBidAdapter.js +1 -1
- package/dist/marsmediaAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/merkleIdSystem.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/mgidRtdProvider.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/mspa.js +1 -1
- package/dist/mwOpenLinkIdSystem.js +1 -1
- package/dist/nativoBidAdapter.js +1 -1
- package/dist/naveggIdSystem.js +1 -1
- package/dist/neuwoRtdProvider.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +248 -247
- package/dist/novatiqIdSystem.js +1 -1
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/open8BidAdapter.js +1 -1
- package/dist/operaadsBidAdapter.js +1 -1
- package/dist/operaadsIdSystem.js +1 -0
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/optimeraRtdProvider.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.js +1 -1
- package/dist/oxxionRtdProvider.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/prismaBidAdapter.js +1 -1
- package/dist/pubgeniusBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- 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/qwarryBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/reconciliationRtdProvider.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/relevadRtdProvider.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rivrAnalyticsAdapter.js +1 -1
- package/dist/roxotAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/scaleableAnalyticsAdapter.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/silverpushBidAdapter.js +1 -1
- package/dist/sirdataRtdProvider.js +1 -1
- package/dist/slimcutBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smartyadsBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/snigelBidAdapter.js +1 -1
- package/dist/sonobiAnalyticsAdapter.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/staqAnalyticsAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/talkadsBidAdapter.js +1 -1
- package/dist/tapadIdSystem.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/teadsIdSystem.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/timeoutRtdProvider.js +1 -1
- package/dist/topicsFpdModule.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/unifiedIdSystem.js +1 -1
- package/dist/verizonMediaIdSystem.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vrtcalBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/yuktamediaAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/growthcode.html +3 -12
- package/integrationExamples/topics/topics-server.js +72 -0
- package/libraries/mspa/activityControls.js +3 -1
- package/modules/.submodules.json +2 -1
- package/modules/a1MediaRtdProvider.js +1 -1
- package/modules/adagioBidAdapter.js +11 -3
- package/modules/admaticBidAdapter.js +5 -0
- package/modules/adqueryBidAdapter.js +23 -21
- package/modules/adqueryIdSystem.js +45 -30
- package/modules/adrelevantisBidAdapter.js +2 -0
- package/modules/bidViewability.js +7 -0
- package/modules/bidViewability.md +9 -8
- package/modules/brandmetricsRtdProvider.js +30 -27
- package/modules/concertBidAdapter.js +1 -0
- package/modules/criteoBidAdapter.js +66 -43
- package/modules/fledgeForGpt.js +17 -4
- package/modules/fledgeForGpt.md +17 -10
- package/modules/geoedgeRtdProvider.js +44 -18
- package/modules/geoedgeRtdProvider.md +2 -1
- package/modules/growthCodeAnalyticsAdapter.js +7 -4
- package/modules/growthCodeAnalyticsAdapter.md +1 -7
- package/modules/liveIntentIdSystem.js +16 -1
- package/modules/nativoBidAdapter.js +21 -3
- package/modules/nexx360BidAdapter.js +7 -1
- package/modules/onetagBidAdapter.js +3 -0
- package/modules/operaadsBidAdapter.js +5 -0
- package/modules/operaadsBidAdapter.md +5 -5
- package/modules/operaadsIdSystem.js +106 -0
- package/modules/operaadsIdSystem.md +52 -0
- package/modules/oxxionAnalyticsAdapter.js +22 -5
- package/modules/prebidServerBidAdapter/index.js +8 -2
- package/modules/pubmaticAnalyticsAdapter.js +16 -3
- package/modules/rubiconBidAdapter.js +2 -2
- package/modules/smartyadsBidAdapter.js +18 -1
- package/modules/snigelBidAdapter.js +69 -16
- package/modules/snigelBidAdapter.md +9 -3
- package/modules/topicsFpdModule.js +35 -9
- package/modules/visxBidAdapter.js +51 -1
- package/package.json +2 -2
- package/src/adapters/bidderFactory.js +14 -5
- package/src/adloader.js +1 -0
- package/src/ajax.js +126 -87
- package/src/constants.json +8 -2
- package/src/native.js +14 -3
- package/test/mocks/xhr.js +256 -9
- package/test/spec/libraries/mspa/activityControls_spec.js +6 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +15 -0
- package/test/spec/modules/adlooxAdServerVideo_spec.js +1 -5
- package/test/spec/modules/adlooxRtdProvider_spec.js +1 -5
- package/test/spec/modules/admaticBidAdapter_spec.js +5 -0
- package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
- package/test/spec/modules/bidViewability_spec.js +32 -1
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
- package/test/spec/modules/categoryTranslation_spec.js +7 -9
- package/test/spec/modules/concertBidAdapter_spec.js +1 -1
- package/test/spec/modules/conversantAnalyticsAdapter_spec.js +3 -5
- package/test/spec/modules/criteoBidAdapter_spec.js +228 -0
- package/test/spec/modules/currency_spec.js +2 -2
- package/test/spec/modules/dmdIdSystem_spec.js +2 -2
- package/test/spec/modules/eids_spec.js +48 -0
- package/test/spec/modules/euidIdSystem_spec.js +10 -9
- package/test/spec/modules/feedadBidAdapter_spec.js +1 -1
- package/test/spec/modules/fledge_spec.js +117 -43
- package/test/spec/modules/geoedgeRtdProvider_spec.js +52 -39
- package/test/spec/modules/greenbidsRtdProvider_spec.js +3 -12
- package/test/spec/modules/growthCodeAnalyticsAdapter_spec.js +0 -1
- package/test/spec/modules/hadronIdSystem_spec.js +1 -1
- package/test/spec/modules/id5AnalyticsAdapter_spec.js +1 -7
- package/test/spec/modules/id5IdSystem_spec.js +25 -25
- package/test/spec/modules/identityLinkIdSystem_spec.js +0 -2
- package/test/spec/modules/intentIqIdSystem_spec.js +0 -2
- package/test/spec/modules/invisiblyAnalyticsAdapter_spec.js +2 -6
- package/test/spec/modules/jwplayerRtdProvider_spec.js +26 -28
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +2 -2
- package/test/spec/modules/mgidRtdProvider_spec.js +1 -5
- package/test/spec/modules/nativoBidAdapter_spec.js +6 -1
- package/test/spec/modules/nexx360BidAdapter_spec.js +48 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +5 -19
- package/test/spec/modules/onetagBidAdapter_spec.js +69 -0
- package/test/spec/modules/ooloAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/operaadsIdSystem_spec.js +53 -0
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +6 -1
- package/test/spec/modules/prebidServerBidAdapter_spec.js +33 -2
- package/test/spec/modules/priceFloors_spec.js +33 -37
- package/test/spec/modules/publinkIdSystem_spec.js +1 -1
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +102 -18
- package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +2 -8
- package/test/spec/modules/rubiconBidAdapter_spec.js +24 -0
- package/test/spec/modules/smartyadsBidAdapter_spec.js +49 -0
- package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
- package/test/spec/modules/teadsIdSystem_spec.js +1 -1
- package/test/spec/modules/topicsFpdModule_spec.js +102 -1
- package/test/spec/modules/uid2IdSystem_helpers.js +5 -5
- package/test/spec/modules/uid2IdSystem_spec.js +24 -24
- package/test/spec/modules/userId_spec.js +1 -1
- package/test/spec/modules/visxBidAdapter_spec.js +151 -1
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +2 -5
- package/test/spec/native_spec.js +20 -5
- package/test/spec/unit/core/ajax_spec.js +403 -0
- package/test/spec/unit/core/bidderFactory_spec.js +80 -8
- package/test/spec/videoCache_spec.js +4 -4
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
reset,
|
|
9
9
|
topicStorageName
|
|
10
10
|
} from '../../../modules/topicsFpdModule.js';
|
|
11
|
+
import {config} from 'src/config.js';
|
|
11
12
|
import {deepClone, safeJSONParse} from '../../../src/utils.js';
|
|
12
13
|
import {getCoreStorageManager} from 'src/storageManager.js';
|
|
13
|
-
import {config} from 'src/config.js';
|
|
14
14
|
import * as activities from '../../../src/activities/rules.js';
|
|
15
15
|
import {ACTIVITY_ENRICH_UFPD} from '../../../src/activities/activities.js';
|
|
16
16
|
|
|
@@ -414,3 +414,104 @@ describe('topics', () => {
|
|
|
414
414
|
});
|
|
415
415
|
});
|
|
416
416
|
});
|
|
417
|
+
|
|
418
|
+
describe('handles fetch request for topics api headers', () => {
|
|
419
|
+
let stubbedFetch;
|
|
420
|
+
const storage = getCoreStorageManager('topicsFpd');
|
|
421
|
+
|
|
422
|
+
beforeEach(() => {
|
|
423
|
+
stubbedFetch = sinon.stub(window, 'fetch');
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
afterEach(() => {
|
|
427
|
+
stubbedFetch.restore();
|
|
428
|
+
storage.removeDataFromLocalStorage(topicStorageName);
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
it('should make a fetch call when a fetchUrl is present for a selected bidder', () => {
|
|
432
|
+
config.setConfig({
|
|
433
|
+
userSync: {
|
|
434
|
+
topics: {
|
|
435
|
+
maxTopicCaller: 3,
|
|
436
|
+
bidders: [
|
|
437
|
+
{
|
|
438
|
+
bidder: 'pubmatic',
|
|
439
|
+
fetchUrl: 'http://localhost:3000/topics-server.js'
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
},
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
stubbedFetch.returns(Promise.resolve(true));
|
|
447
|
+
loadTopicsForBidders({
|
|
448
|
+
browsingTopics: true,
|
|
449
|
+
featurePolicy: {
|
|
450
|
+
allowsFeature() { return true }
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
sinon.assert.calledOnce(stubbedFetch);
|
|
454
|
+
stubbedFetch.calledWith('http://localhost:3000/topics-server.js');
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
it('should not make a fetch call when a fetchUrl is not present for a selected bidder', () => {
|
|
458
|
+
config.setConfig({
|
|
459
|
+
userSync: {
|
|
460
|
+
topics: {
|
|
461
|
+
maxTopicCaller: 3,
|
|
462
|
+
bidders: [
|
|
463
|
+
{
|
|
464
|
+
bidder: 'pubmatic'
|
|
465
|
+
}
|
|
466
|
+
],
|
|
467
|
+
},
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
loadTopicsForBidders({
|
|
472
|
+
browsingTopics: true,
|
|
473
|
+
featurePolicy: {
|
|
474
|
+
allowsFeature() { return true }
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
sinon.assert.notCalled(stubbedFetch);
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
it('a fetch request should not be made if the configured fetch rate duration has not yet passed', () => {
|
|
481
|
+
const storedSegments = JSON.stringify(
|
|
482
|
+
[['pubmatic', {
|
|
483
|
+
'2206021246': {
|
|
484
|
+
'ext': {'segtax': 600, 'segclass': '2206021246'},
|
|
485
|
+
'segment': [{'id': '243'}, {'id': '265'}],
|
|
486
|
+
'name': 'ads.pubmatic.com'
|
|
487
|
+
},
|
|
488
|
+
'lastUpdated': new Date().getTime()
|
|
489
|
+
}]]
|
|
490
|
+
);
|
|
491
|
+
|
|
492
|
+
storage.setDataInLocalStorage(topicStorageName, storedSegments);
|
|
493
|
+
|
|
494
|
+
config.setConfig({
|
|
495
|
+
userSync: {
|
|
496
|
+
topics: {
|
|
497
|
+
maxTopicCaller: 3,
|
|
498
|
+
bidders: [
|
|
499
|
+
{
|
|
500
|
+
bidder: 'pubmatic',
|
|
501
|
+
fetchUrl: 'http://localhost:3000/topics-server.js',
|
|
502
|
+
fetchRate: 1 // in days. 1 fetch per day
|
|
503
|
+
}
|
|
504
|
+
],
|
|
505
|
+
},
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
loadTopicsForBidders({
|
|
510
|
+
browsingTopics: true,
|
|
511
|
+
featurePolicy: {
|
|
512
|
+
allowsFeature() { return true }
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
sinon.assert.notCalled(stubbedFetch);
|
|
516
|
+
});
|
|
517
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {coreStorage,
|
|
1
|
+
import {setConsentConfig} from 'modules/consentManagement.js';
|
|
2
|
+
import {server} from 'test/mocks/xhr.js';
|
|
3
|
+
import {coreStorage, requestBidsHook} from 'modules/userId/index.js';
|
|
4
4
|
|
|
5
5
|
const msIn12Hours = 60 * 60 * 12 * 1000;
|
|
6
6
|
const expireCookieDate = 'Thu, 01 Jan 1970 00:00:01 GMT';
|
|
@@ -34,8 +34,8 @@ export const apiHelpers = {
|
|
|
34
34
|
refresh_expires: Date.now() + 24 * 60 * 60 * 1000, // 24 hours
|
|
35
35
|
refresh_response_key: 'wR5t6HKMfJ2r4J7fEGX9Gw==', // Fake data
|
|
36
36
|
}),
|
|
37
|
-
respondAfterDelay: (delay) => new Promise((resolve) => setTimeout(() => {
|
|
38
|
-
|
|
37
|
+
respondAfterDelay: (delay, srv = server) => new Promise((resolve) => setTimeout(() => {
|
|
38
|
+
srv.respond();
|
|
39
39
|
setTimeout(() => resolve());
|
|
40
40
|
}, delay)),
|
|
41
41
|
}
|
|
@@ -7,7 +7,6 @@ import { uid2IdSubmodule } from 'modules/uid2IdSystem.js';
|
|
|
7
7
|
import 'src/prebid.js';
|
|
8
8
|
import 'modules/consentManagement.js';
|
|
9
9
|
import { getGlobal } from 'src/prebidGlobal.js';
|
|
10
|
-
import { server } from 'test/mocks/xhr.js';
|
|
11
10
|
import { configureTimerInterceptors } from 'test/mocks/timers.js';
|
|
12
11
|
import { cookieHelpers, runAuction, apiHelpers, setGdprApplies } from './uid2IdSystem_helpers.js';
|
|
13
12
|
import {hook} from 'src/hook.js';
|
|
@@ -56,22 +55,6 @@ const expectModuleStorageToContain = (initialIdentity, latestIdentity) => {
|
|
|
56
55
|
const apiUrl = 'https://prod.uidapi.com/v2/token/refresh';
|
|
57
56
|
const headers = { 'Content-Type': 'application/json' };
|
|
58
57
|
const makeSuccessResponseBody = () => btoa(JSON.stringify({ status: 'success', body: { ...apiHelpers.makeTokenResponse(initialToken), advertising_token: refreshedToken } }));
|
|
59
|
-
const configureUid2Response = (httpStatus, response) => server.respondWith('POST', apiUrl, (xhr) => xhr.respond(httpStatus, headers, response));
|
|
60
|
-
const configureUid2ApiSuccessResponse = () => configureUid2Response(200, makeSuccessResponseBody());
|
|
61
|
-
const configureUid2ApiFailResponse = () => configureUid2Response(500, 'Error');
|
|
62
|
-
|
|
63
|
-
// Runs the provided test twice - once with a successful API mock, once with one which returns a server error
|
|
64
|
-
const testApiSuccessAndFailure = (act, testDescription, failTestDescription, only = false) => {
|
|
65
|
-
const testFn = only ? it.only : it;
|
|
66
|
-
testFn(`API responds successfully: ${testDescription}`, async function() {
|
|
67
|
-
configureUid2ApiSuccessResponse();
|
|
68
|
-
await act(true);
|
|
69
|
-
});
|
|
70
|
-
testFn(`API responds with an error: ${failTestDescription ?? testDescription}`, async function() {
|
|
71
|
-
configureUid2ApiFailResponse();
|
|
72
|
-
await act(false);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
58
|
|
|
76
59
|
const testCookieAndLocalStorage = (description, test, only = false) => {
|
|
77
60
|
const describeFn = only ? describe.only : describe;
|
|
@@ -93,7 +76,7 @@ const testCookieAndLocalStorage = (description, test, only = false) => {
|
|
|
93
76
|
};
|
|
94
77
|
|
|
95
78
|
describe(`UID2 module`, function () {
|
|
96
|
-
let suiteSandbox, testSandbox, timerSpy, fullTestTitle, restoreSubtleToUndefined = false;
|
|
79
|
+
let server, suiteSandbox, testSandbox, timerSpy, fullTestTitle, restoreSubtleToUndefined = false;
|
|
97
80
|
before(function () {
|
|
98
81
|
timerSpy = configureTimerInterceptors(debugOutput);
|
|
99
82
|
hook.ready();
|
|
@@ -116,13 +99,31 @@ describe(`UID2 module`, function () {
|
|
|
116
99
|
if (restoreSubtleToUndefined) window.crypto.subtle = undefined;
|
|
117
100
|
});
|
|
118
101
|
|
|
102
|
+
const configureUid2Response = (httpStatus, response) => server.respondWith('POST', apiUrl, (xhr) => xhr.respond(httpStatus, headers, response));
|
|
103
|
+
const configureUid2ApiSuccessResponse = () => configureUid2Response(200, makeSuccessResponseBody());
|
|
104
|
+
const configureUid2ApiFailResponse = () => configureUid2Response(500, 'Error');
|
|
105
|
+
// Runs the provided test twice - once with a successful API mock, once with one which returns a server error
|
|
106
|
+
const testApiSuccessAndFailure = (act, testDescription, failTestDescription, only = false) => {
|
|
107
|
+
const testFn = only ? it.only : it;
|
|
108
|
+
testFn(`API responds successfully: ${testDescription}`, async function() {
|
|
109
|
+
configureUid2ApiSuccessResponse();
|
|
110
|
+
await act(true);
|
|
111
|
+
});
|
|
112
|
+
testFn(`API responds with an error: ${failTestDescription ?? testDescription}`, async function() {
|
|
113
|
+
configureUid2ApiFailResponse();
|
|
114
|
+
await act(false);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
119
118
|
const getFullTestTitle = (test) => `${test.parent.title ? getFullTestTitle(test.parent) + ' | ' : ''}${test.title}`;
|
|
119
|
+
|
|
120
120
|
beforeEach(function () {
|
|
121
121
|
debugOutput(`----------------- START TEST ------------------`);
|
|
122
122
|
fullTestTitle = getFullTestTitle(this.test.ctx.currentTest);
|
|
123
123
|
debugOutput(fullTestTitle);
|
|
124
124
|
testSandbox = sinon.sandbox.create();
|
|
125
125
|
testSandbox.stub(utils, 'logWarn');
|
|
126
|
+
server = sinon.createFakeServer();
|
|
126
127
|
|
|
127
128
|
init(config);
|
|
128
129
|
setSubmoduleRegistry([uid2IdSubmodule]);
|
|
@@ -143,7 +144,6 @@ describe(`UID2 module`, function () {
|
|
|
143
144
|
}
|
|
144
145
|
cookieHelpers.clearCookies(moduleCookieName, publisherCookieName);
|
|
145
146
|
coreStorage.removeDataFromLocalStorage(moduleCookieName);
|
|
146
|
-
|
|
147
147
|
debugOutput('----------------- END TEST ------------------');
|
|
148
148
|
});
|
|
149
149
|
|
|
@@ -247,7 +247,7 @@ describe(`UID2 module`, function () {
|
|
|
247
247
|
describe('When the refresh is available in time', function() {
|
|
248
248
|
testApiSuccessAndFailure(async function(apiSucceeds) {
|
|
249
249
|
scenario.setConfig(apiHelpers.makeTokenResponse(initialToken, true, true));
|
|
250
|
-
apiHelpers.respondAfterDelay(auctionDelayMs / 10);
|
|
250
|
+
apiHelpers.respondAfterDelay(auctionDelayMs / 10, server);
|
|
251
251
|
const bid = await runAuction();
|
|
252
252
|
|
|
253
253
|
if (apiSucceeds) expectToken(bid, refreshedToken);
|
|
@@ -256,7 +256,7 @@ describe(`UID2 module`, function () {
|
|
|
256
256
|
|
|
257
257
|
testApiSuccessAndFailure(async function(apiSucceeds) {
|
|
258
258
|
scenario.setConfig(apiHelpers.makeTokenResponse(initialToken, true, true));
|
|
259
|
-
apiHelpers.respondAfterDelay(auctionDelayMs / 10);
|
|
259
|
+
apiHelpers.respondAfterDelay(auctionDelayMs / 10, server);
|
|
260
260
|
|
|
261
261
|
await runAuction();
|
|
262
262
|
if (apiSucceeds) {
|
|
@@ -275,7 +275,7 @@ describe(`UID2 module`, function () {
|
|
|
275
275
|
|
|
276
276
|
testApiSuccessAndFailure(async function(apiSucceeds) {
|
|
277
277
|
scenario.setConfig(apiHelpers.makeTokenResponse(initialToken, true, true));
|
|
278
|
-
const promise = apiHelpers.respondAfterDelay(auctionDelayMs * 2);
|
|
278
|
+
const promise = apiHelpers.respondAfterDelay(auctionDelayMs * 2, server);
|
|
279
279
|
|
|
280
280
|
const bid = await runAuction();
|
|
281
281
|
expectNoIdentity(bid);
|
|
@@ -319,13 +319,13 @@ describe(`UID2 module`, function () {
|
|
|
319
319
|
scenario.setConfig(apiHelpers.makeTokenResponse(initialToken, true), {auctionDelay: 0, syncDelay: 1});
|
|
320
320
|
});
|
|
321
321
|
testApiSuccessAndFailure(async function() {
|
|
322
|
-
apiHelpers.respondAfterDelay(10);
|
|
322
|
+
apiHelpers.respondAfterDelay(10, server);
|
|
323
323
|
const bid = await runAuction();
|
|
324
324
|
expectToken(bid, initialToken);
|
|
325
325
|
}, 'it should not be refreshed before the auction runs');
|
|
326
326
|
|
|
327
327
|
testApiSuccessAndFailure(async function(success) {
|
|
328
|
-
const promise = apiHelpers.respondAfterDelay(1);
|
|
328
|
+
const promise = apiHelpers.respondAfterDelay(1, server);
|
|
329
329
|
await runAuction();
|
|
330
330
|
await promise;
|
|
331
331
|
if (success) {
|
|
@@ -3005,7 +3005,7 @@ describe('User ID', function () {
|
|
|
3005
3005
|
expect(server.requests).to.be.empty;
|
|
3006
3006
|
return endAuction();
|
|
3007
3007
|
}).then(() => {
|
|
3008
|
-
expect(server.requests[0].url).to.
|
|
3008
|
+
expect(server.requests[0].url).to.match(/\/any\/unifiedid\/url/);
|
|
3009
3009
|
});
|
|
3010
3010
|
});
|
|
3011
3011
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { spec } from 'modules/visxBidAdapter.js';
|
|
2
|
+
import { spec, storage } from 'modules/visxBidAdapter.js';
|
|
3
3
|
import { config } from 'src/config.js';
|
|
4
4
|
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
5
5
|
import * as utils from 'src/utils.js';
|
|
@@ -82,6 +82,9 @@ describe('VisxAdapter', function () {
|
|
|
82
82
|
});
|
|
83
83
|
return res;
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
let cookiesAreEnabledStub, localStorageIsEnabledStub;
|
|
87
|
+
|
|
85
88
|
const bidderRequest = {
|
|
86
89
|
timeout: 3000,
|
|
87
90
|
refererInfo: {
|
|
@@ -180,6 +183,24 @@ describe('VisxAdapter', function () {
|
|
|
180
183
|
'ext': {'bidder': {'uid': 903537}}
|
|
181
184
|
}];
|
|
182
185
|
|
|
186
|
+
before(() => {
|
|
187
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
188
|
+
visx: {
|
|
189
|
+
storageAllowed: false
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
193
|
+
cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
|
|
194
|
+
localStorageIsEnabledStub.returns(false);
|
|
195
|
+
cookiesAreEnabledStub.returns(false);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
after(() => {
|
|
199
|
+
localStorageIsEnabledStub.restore();
|
|
200
|
+
cookiesAreEnabledStub.restore();
|
|
201
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
202
|
+
});
|
|
203
|
+
|
|
183
204
|
it('should attach valid params to the tag', function () {
|
|
184
205
|
const firstBid = bidRequests[0];
|
|
185
206
|
const bids = [firstBid];
|
|
@@ -422,6 +443,7 @@ describe('VisxAdapter', function () {
|
|
|
422
443
|
});
|
|
423
444
|
return res;
|
|
424
445
|
}
|
|
446
|
+
let cookiesAreEnabledStub, localStorageIsEnabledStub;
|
|
425
447
|
const bidderRequest = {
|
|
426
448
|
timeout: 3000,
|
|
427
449
|
refererInfo: {
|
|
@@ -449,6 +471,24 @@ describe('VisxAdapter', function () {
|
|
|
449
471
|
}
|
|
450
472
|
];
|
|
451
473
|
|
|
474
|
+
before(() => {
|
|
475
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
476
|
+
visx: {
|
|
477
|
+
storageAllowed: false
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
481
|
+
cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
|
|
482
|
+
localStorageIsEnabledStub.returns(false);
|
|
483
|
+
cookiesAreEnabledStub.returns(false);
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
after(() => {
|
|
487
|
+
localStorageIsEnabledStub.restore();
|
|
488
|
+
cookiesAreEnabledStub.restore();
|
|
489
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
490
|
+
});
|
|
491
|
+
|
|
452
492
|
it('should send requst for banner bid', function () {
|
|
453
493
|
const request = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
454
494
|
const payload = parseRequest(request.url);
|
|
@@ -486,6 +526,7 @@ describe('VisxAdapter', function () {
|
|
|
486
526
|
});
|
|
487
527
|
return res;
|
|
488
528
|
}
|
|
529
|
+
let cookiesAreEnabledStub, localStorageIsEnabledStub;
|
|
489
530
|
const bidderRequest = {
|
|
490
531
|
timeout: 3000,
|
|
491
532
|
refererInfo: {
|
|
@@ -529,10 +570,23 @@ describe('VisxAdapter', function () {
|
|
|
529
570
|
documentStub.withArgs('visx-adunit-element-2').returns({
|
|
530
571
|
id: 'visx-adunit-element-2'
|
|
531
572
|
});
|
|
573
|
+
|
|
574
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
575
|
+
visx: {
|
|
576
|
+
storageAllowed: false
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
580
|
+
cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
|
|
581
|
+
localStorageIsEnabledStub.returns(false);
|
|
582
|
+
cookiesAreEnabledStub.returns(false);
|
|
532
583
|
});
|
|
533
584
|
|
|
534
585
|
after(function() {
|
|
535
586
|
sandbox.restore();
|
|
587
|
+
localStorageIsEnabledStub.restore();
|
|
588
|
+
cookiesAreEnabledStub.restore();
|
|
589
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
536
590
|
});
|
|
537
591
|
|
|
538
592
|
it('should find ad slot by ad unit code as element id', function () {
|
|
@@ -1323,4 +1377,100 @@ describe('VisxAdapter', function () {
|
|
|
1323
1377
|
expect(query).to.deep.equal({});
|
|
1324
1378
|
});
|
|
1325
1379
|
});
|
|
1380
|
+
|
|
1381
|
+
describe('first party user id', function () {
|
|
1382
|
+
const USER_ID_KEY = '__vads';
|
|
1383
|
+
const USER_ID_DUMMY_VALUE_COOKIE = 'dummy_id_cookie';
|
|
1384
|
+
const USER_ID_DUMMY_VALUE_LOCAL_STORAGE = 'dummy_id_local_storage';
|
|
1385
|
+
|
|
1386
|
+
let getDataFromLocalStorageStub, localStorageIsEnabledStub;
|
|
1387
|
+
let getCookieStub, cookiesAreEnabledStub;
|
|
1388
|
+
|
|
1389
|
+
const bidRequests = [
|
|
1390
|
+
{
|
|
1391
|
+
'bidder': 'visx',
|
|
1392
|
+
'params': {
|
|
1393
|
+
'uid': 903535
|
|
1394
|
+
},
|
|
1395
|
+
'adUnitCode': 'adunit-code-1',
|
|
1396
|
+
'sizes': [[300, 250], [300, 600]],
|
|
1397
|
+
'bidId': '30b31c1838de1e',
|
|
1398
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
1399
|
+
'auctionId': '1d1a030790a475',
|
|
1400
|
+
}
|
|
1401
|
+
];
|
|
1402
|
+
const bidderRequest = {
|
|
1403
|
+
timeout: 3000,
|
|
1404
|
+
refererInfo: {
|
|
1405
|
+
page: 'https://example.com'
|
|
1406
|
+
}
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
beforeEach(() => {
|
|
1410
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
1411
|
+
visx: {
|
|
1412
|
+
storageAllowed: true
|
|
1413
|
+
}
|
|
1414
|
+
};
|
|
1415
|
+
cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
|
|
1416
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
1417
|
+
});
|
|
1418
|
+
|
|
1419
|
+
afterEach(() => {
|
|
1420
|
+
cookiesAreEnabledStub.restore();
|
|
1421
|
+
localStorageIsEnabledStub.restore();
|
|
1422
|
+
getCookieStub && getCookieStub.restore();
|
|
1423
|
+
getDataFromLocalStorageStub && getDataFromLocalStorageStub.restore();
|
|
1424
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
1425
|
+
});
|
|
1426
|
+
|
|
1427
|
+
it('should not pass user id if both cookies and local storage are not available', function () {
|
|
1428
|
+
cookiesAreEnabledStub.returns(false);
|
|
1429
|
+
localStorageIsEnabledStub.returns(false);
|
|
1430
|
+
|
|
1431
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1432
|
+
|
|
1433
|
+
expect(request.data.user).to.be.undefined;
|
|
1434
|
+
});
|
|
1435
|
+
|
|
1436
|
+
it('should get user id from cookie if available', function () {
|
|
1437
|
+
cookiesAreEnabledStub.returns(true);
|
|
1438
|
+
localStorageIsEnabledStub.returns(false);
|
|
1439
|
+
getCookieStub = sinon.stub(storage, 'getCookie');
|
|
1440
|
+
getCookieStub.withArgs(USER_ID_KEY).returns(USER_ID_DUMMY_VALUE_COOKIE);
|
|
1441
|
+
|
|
1442
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1443
|
+
|
|
1444
|
+
expect(request.data.user.ext.vads).to.equal(USER_ID_DUMMY_VALUE_COOKIE);
|
|
1445
|
+
});
|
|
1446
|
+
|
|
1447
|
+
it('should get user id from local storage if available', function () {
|
|
1448
|
+
cookiesAreEnabledStub.returns(false);
|
|
1449
|
+
localStorageIsEnabledStub.returns(true);
|
|
1450
|
+
getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage');
|
|
1451
|
+
getDataFromLocalStorageStub.withArgs(USER_ID_KEY).returns(USER_ID_DUMMY_VALUE_LOCAL_STORAGE);
|
|
1452
|
+
|
|
1453
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1454
|
+
|
|
1455
|
+
expect(request.data.user.ext.vads).to.equal(USER_ID_DUMMY_VALUE_LOCAL_STORAGE);
|
|
1456
|
+
});
|
|
1457
|
+
|
|
1458
|
+
it('should create user id and store it in cookies (if user id does not exist)', function () {
|
|
1459
|
+
cookiesAreEnabledStub.returns(true);
|
|
1460
|
+
localStorageIsEnabledStub.returns(false);
|
|
1461
|
+
|
|
1462
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1463
|
+
expect(storage.getCookie(USER_ID_KEY)).to.be.a('string');
|
|
1464
|
+
expect(request.data.user.ext.vads).to.be.a('string');
|
|
1465
|
+
});
|
|
1466
|
+
|
|
1467
|
+
it('should create user id and store it in local storage (if user id does not exist)', function () {
|
|
1468
|
+
cookiesAreEnabledStub.returns(false);
|
|
1469
|
+
localStorageIsEnabledStub.returns(true);
|
|
1470
|
+
|
|
1471
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1472
|
+
expect(storage.getDataFromLocalStorage(USER_ID_KEY)).to.be.a('string');
|
|
1473
|
+
expect(request.data.user.ext.vads).to.be.a('string');
|
|
1474
|
+
});
|
|
1475
|
+
});
|
|
1326
1476
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import zetaAnalyticsAdapter from 'modules/zeta_global_sspAnalyticsAdapter.js';
|
|
2
2
|
import {config} from 'src/config';
|
|
3
3
|
import CONSTANTS from 'src/constants.json';
|
|
4
|
-
import {
|
|
4
|
+
import {server} from '../../mocks/xhr.js';
|
|
5
5
|
|
|
6
6
|
let utils = require('src/utils');
|
|
7
7
|
let events = require('src/events');
|
|
@@ -358,14 +358,11 @@ const MOCK = {
|
|
|
358
358
|
|
|
359
359
|
describe('Zeta Global SSP Analytics Adapter', function() {
|
|
360
360
|
let sandbox;
|
|
361
|
-
let xhr;
|
|
362
361
|
let requests;
|
|
363
362
|
|
|
364
363
|
beforeEach(function() {
|
|
365
364
|
sandbox = sinon.sandbox.create();
|
|
366
|
-
requests =
|
|
367
|
-
xhr = sandbox.useFakeXMLHttpRequest();
|
|
368
|
-
xhr.onCreate = request => requests.push(request);
|
|
365
|
+
requests = server.requests;
|
|
369
366
|
sandbox.stub(events, 'getEvents').returns([]);
|
|
370
367
|
});
|
|
371
368
|
|
package/test/spec/native_spec.js
CHANGED
|
@@ -631,7 +631,8 @@ describe('native.js', function () {
|
|
|
631
631
|
eventtrackers: [
|
|
632
632
|
{ event: 1, method: 1, url: 'https://sampleurl.com' },
|
|
633
633
|
{ event: 1, method: 2, url: 'https://sampleurljs.com' }
|
|
634
|
-
]
|
|
634
|
+
],
|
|
635
|
+
imptrackers: [ 'https://sample-imp.com' ]
|
|
635
636
|
}
|
|
636
637
|
describe('toLegacyResponse', () => {
|
|
637
638
|
it('returns assets in legacy format for ortb responses', () => {
|
|
@@ -640,8 +641,9 @@ describe('native.js', function () {
|
|
|
640
641
|
expect(actual.title).to.equal('vtitle');
|
|
641
642
|
expect(actual.clickUrl).to.equal('url');
|
|
642
643
|
expect(actual.javascriptTrackers).to.equal('<script async src="https://sampleurljs.com"></script>');
|
|
643
|
-
expect(actual.impressionTrackers.length).to.equal(
|
|
644
|
-
expect(actual.impressionTrackers
|
|
644
|
+
expect(actual.impressionTrackers.length).to.equal(2);
|
|
645
|
+
expect(actual.impressionTrackers).to.contain('https://sampleurl.com');
|
|
646
|
+
expect(actual.impressionTrackers).to.contain('https://sample-imp.com');
|
|
645
647
|
});
|
|
646
648
|
});
|
|
647
649
|
});
|
|
@@ -860,6 +862,9 @@ describe('validate native', function () {
|
|
|
860
862
|
}]
|
|
861
863
|
},
|
|
862
864
|
address: {},
|
|
865
|
+
privacyLink: {
|
|
866
|
+
required: true
|
|
867
|
+
}
|
|
863
868
|
},
|
|
864
869
|
},
|
|
865
870
|
};
|
|
@@ -915,6 +920,7 @@ describe('validate native', function () {
|
|
|
915
920
|
type: 9,
|
|
916
921
|
}
|
|
917
922
|
});
|
|
923
|
+
expect(ortb.privacy).to.equal(1);
|
|
918
924
|
});
|
|
919
925
|
|
|
920
926
|
['bogusKey', 'clickUrl', 'privacyLink'].forEach(nativeKey => {
|
|
@@ -1022,11 +1028,14 @@ describe('validate native', function () {
|
|
|
1022
1028
|
expect(oldNativeRequest.sponsoredBy).to.include({
|
|
1023
1029
|
required: true,
|
|
1024
1030
|
len: 25
|
|
1025
|
-
})
|
|
1031
|
+
});
|
|
1026
1032
|
expect(oldNativeRequest.body).to.include({
|
|
1027
1033
|
required: true,
|
|
1028
1034
|
len: 140
|
|
1029
|
-
})
|
|
1035
|
+
});
|
|
1036
|
+
expect(oldNativeRequest.privacyLink).to.include({
|
|
1037
|
+
required: false
|
|
1038
|
+
});
|
|
1030
1039
|
});
|
|
1031
1040
|
|
|
1032
1041
|
if (FEATURES.NATIVE) {
|
|
@@ -1197,6 +1206,12 @@ describe('legacyPropertiesToOrtbNative', () => {
|
|
|
1197
1206
|
expect(native.jstracker).to.eql('some-markupsome-other-markup');
|
|
1198
1207
|
})
|
|
1199
1208
|
});
|
|
1209
|
+
describe('privacylink', () => {
|
|
1210
|
+
it('should convert privacyLink to privacy', () => {
|
|
1211
|
+
const native = legacyPropertiesToOrtbNative({privacyLink: 'https:/my-privacy-link.com'});
|
|
1212
|
+
expect(native.privacy).to.eql('https:/my-privacy-link.com');
|
|
1213
|
+
})
|
|
1214
|
+
})
|
|
1200
1215
|
});
|
|
1201
1216
|
|
|
1202
1217
|
describe('fireImpressionTrackers', () => {
|