prebid.js 7.10.0 → 7.13.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/.github/PULL_REQUEST_TEMPLATE.md +16 -10
- package/.github/codeql/codeql-config.yml +4 -0
- package/.github/workflows/codeql-analysis.yml +73 -0
- package/.github/workflows/issue_tracker.yml +1 -1
- package/README.md +0 -2
- package/babelConfig.js +10 -4
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/acuityAdsBidAdapter.js +1 -0
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adriverBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtelligentBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -0
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.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/aniviewBidAdapter.js +1 -1
- package/dist/aolBidAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/audiencerunBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/betweenBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/cleanioRtdProvider.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consentManagementUsp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/cpmstarBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/datawrkzBidAdapter.js +1 -0
- package/dist/debugging-standalone.js +1 -1
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/displayioBidAdapter.js +1 -3
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/enrichmentFpdModule.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imRtdProvider.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.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/kargoBidAdapter.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 -0
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -0
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediagoBidAdapter.js +1 -0
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +153 -147
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneKeyIdSystem.js +1 -0
- package/dist/oneKeyRtdProvider.js +1 -0
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- 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/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/rasBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rtbhouseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.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/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/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/trustpidSystem.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/viewability.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/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/permutiveRtdProvider_example.html +1 -1
- package/karma.conf.maker.js +2 -13
- package/modules/.submodules.json +2 -0
- package/modules/acuityAdsBidAdapter.js +207 -0
- package/modules/acuityAdsBidAdapter.md +79 -0
- package/modules/adagioBidAdapter.js +2 -3
- package/modules/adgenerationBidAdapter.js +2 -2
- package/modules/adkernelBidAdapter.js +28 -12
- package/modules/admixerBidAdapter.js +1 -1
- package/modules/adnowBidAdapter.js +1 -1
- package/modules/adpod.js +1 -1
- package/modules/adrelevantisBidAdapter.js +2 -2
- package/modules/adriverBidAdapter.js +5 -12
- package/modules/adriverIdSystem.js +2 -1
- package/modules/adtargetBidAdapter.js +1 -1
- package/modules/adtelligentBidAdapter.js +6 -2
- package/modules/adtrgtmeBidAdapter.js +333 -0
- package/modules/adtrgtmeBidAdapter.md +69 -0
- package/modules/adtrueBidAdapter.js +1 -1
- package/modules/adxpremiumAnalyticsAdapter.js +1 -1
- package/modules/adyoulikeBidAdapter.js +1 -1
- package/modules/alkimiBidAdapter.js +2 -1
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +13 -93
- package/modules/apstreamBidAdapter.js +2 -2
- package/modules/beopBidAdapter.js +4 -4
- package/modules/betweenBidAdapter.js +4 -4
- package/modules/bidwatchAnalyticsAdapter.js +112 -59
- package/modules/bizzclickBidAdapter.js +1 -1
- package/modules/brightMountainMediaBidAdapter.js +1 -1
- package/modules/browsiRtdProvider.js +24 -10
- package/modules/cleanmedianetBidAdapter.js +1 -1
- package/modules/consentManagement.js +1 -1
- package/modules/consentManagementUsp.js +1 -1
- package/modules/consumableBidAdapter.js +43 -3
- package/modules/cpmstarBidAdapter.js +23 -13
- package/modules/criteoBidAdapter.js +19 -13
- package/modules/currency.js +1 -0
- package/modules/cwireBidAdapter.js +1 -1
- package/modules/datablocksBidAdapter.js +1 -1
- package/modules/datawrkzBidAdapter.js +633 -0
- package/modules/datawrkzBidAdapter.md +160 -0
- package/modules/dfpAdServerVideo.js +2 -2
- package/modules/dgkeywordRtdProvider.js +10 -1
- package/modules/displayioBidAdapter.js +92 -97
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/e_volutionBidAdapter.js +3 -3
- package/modules/ebdrBidAdapter.js +1 -1
- package/modules/emx_digitalBidAdapter.js +1 -1
- package/modules/enrichmentFpdModule.js +11 -0
- package/modules/fabrickIdSystem.js +2 -2
- package/modules/gamoshiBidAdapter.js +1 -1
- package/modules/getintentBidAdapter.js +1 -1
- package/modules/gjirafaBidAdapter.js +2 -2
- package/modules/goldbachBidAdapter.js +8 -8
- package/modules/gothamadsBidAdapter.js +2 -2
- package/modules/gumgumBidAdapter.js +3 -3
- package/modules/h12mediaBidAdapter.js +1 -1
- package/modules/id5AnalyticsAdapter.js +1 -1
- package/modules/id5IdSystem.js +160 -111
- package/modules/id5IdSystem.md +16 -14
- package/modules/imRtdProvider.js +20 -7
- package/modules/imRtdProvider.md +3 -1
- package/modules/impactifyBidAdapter.js +1 -1
- package/modules/improvedigitalBidAdapter.js +50 -28
- package/modules/inskinBidAdapter.js +1 -1
- package/modules/insticatorBidAdapter.js +1 -1
- package/modules/integr8BidAdapter.js +2 -2
- package/modules/intentIqIdSystem.js +2 -2
- package/modules/interactiveOffersBidAdapter.js +1 -1
- package/modules/iqmBidAdapter.js +1 -1
- package/modules/ixBidAdapter.js +21 -328
- package/modules/ixBidAdapter.md +1 -19
- package/modules/kargoBidAdapter.js +4 -5
- package/modules/krushmediaBidAdapter.js +2 -2
- package/modules/lassoBidAdapter.js +3 -3
- package/modules/lifestreetBidAdapter.js +143 -0
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +3 -3
- package/modules/lkqdBidAdapter.js +3 -3
- package/modules/loganBidAdapter.js +2 -2
- package/modules/luponmediaBidAdapter.js +3 -3
- package/modules/mabidderBidAdapter.js +60 -0
- package/modules/mabidderBidAdapter.md +31 -0
- package/modules/malltvBidAdapter.js +2 -2
- package/modules/mediagoBidAdapter.js +462 -0
- package/modules/mediagoBidAdapter.md +34 -0
- package/modules/mediakeysBidAdapter.js +2 -2
- package/modules/mgidBidAdapter.js +2 -2
- package/modules/nextMillenniumBidAdapter.js +25 -6
- package/modules/nobidBidAdapter.js +2 -2
- package/modules/novatiqIdSystem.js +1 -1
- package/modules/oneKeyIdSystem.js +78 -0
- package/modules/oneKeyIdSystem.md +109 -0
- package/modules/oneKeyRtdProvider.js +98 -0
- package/modules/oneKeyRtdProvider.md +127 -0
- package/modules/open8BidAdapter.js +1 -1
- package/modules/openwebBidAdapter.js +1 -1
- package/modules/openxAnalyticsAdapter.js +5 -744
- package/modules/openxAnalyticsAdapter.md +4 -0
- package/modules/openxBidAdapter.js +3 -3
- package/modules/permutiveRtdProvider.js +55 -8
- package/modules/pixfutureBidAdapter.js +1 -1
- package/modules/prebidmanagerAnalyticsAdapter.js +1 -1
- package/modules/priceFloors.js +1 -1
- package/modules/pubmaticAnalyticsAdapter.js +1 -1
- package/modules/pubmaticBidAdapter.js +19 -1
- package/modules/pubwiseAnalyticsAdapter.js +1 -1
- package/modules/pubwiseBidAdapter.js +3 -3
- package/modules/pubxBidAdapter.js +1 -1
- package/modules/pubxaiAnalyticsAdapter.js +2 -2
- package/modules/quantcastIdSystem.js +1 -1
- package/modules/radsBidAdapter.js +1 -1
- package/modules/rasBidAdapter.js +8 -0
- package/modules/rasBidAdapter.md +14 -13
- package/modules/revcontentBidAdapter.js +1 -1
- package/modules/richaudienceBidAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +25 -1
- package/modules/schain.js +1 -1
- package/modules/seedtagBidAdapter.md +25 -56
- package/modules/showheroes-bsBidAdapter.js +1 -1
- package/modules/sizeMappingV2.js +1 -1
- package/modules/smaatoBidAdapter.js +2 -2
- package/modules/sonobiAnalyticsAdapter.js +1 -1
- package/modules/sonobiBidAdapter.js +4 -3
- package/modules/staqAnalyticsAdapter.js +1 -1
- package/modules/tappxBidAdapter.js +11 -2
- package/modules/targetVideoBidAdapter.js +1 -1
- package/modules/theAdxBidAdapter.js +2 -2
- package/modules/tpmnBidAdapter.js +1 -1
- package/modules/trionBidAdapter.js +2 -2
- package/modules/tripleliftBidAdapter.js +20 -1
- package/modules/trustpidSystem.js +6 -42
- package/modules/trustpidSystem.md +10 -10
- package/modules/underdogmediaBidAdapter.js +1 -1
- package/modules/userId/eids.js +26 -0
- package/modules/userId/userId.md +2 -2
- package/modules/vdoaiBidAdapter.js +1 -1
- package/modules/vidazooBidAdapter.js +7 -5
- package/modules/vidoomyBidAdapter.js +1 -1
- package/modules/viewability.js +14 -14
- package/modules/winrBidAdapter.js +1 -1
- package/modules/yahoosspBidAdapter.js +3 -3
- package/modules/yandexBidAdapter.js +1 -1
- package/modules/yieldmoBidAdapter.js +3 -3
- package/modules/yieldoneBidAdapter.js +2 -2
- package/modules/zeta_global_sspBidAdapter.js +24 -21
- package/package.json +3 -3
- package/src/Renderer.js +1 -1
- package/src/adloader.js +2 -1
- package/src/adserver.js +0 -56
- package/src/auction.js +60 -16
- package/src/bidfactory.js +1 -1
- package/src/native.js +75 -60
- package/src/refererDetection.js +12 -1
- package/src/sizeMapping.js +5 -7
- package/src/targeting.js +1 -1
- package/src/userSync.js +1 -1
- package/src/utils/promise.js +3 -1
- package/src/utils.js +27 -0
- package/src/video.js +5 -4
- package/src/videoCache.js +8 -2
- package/test/pages/instream.html +2 -2
- package/test/spec/modules/acuityAdsBidAdapter_spec.js +398 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +2 -0
- package/test/spec/modules/adkernelBidAdapter_spec.js +11 -2
- package/test/spec/modules/adriverBidAdapter_spec.js +6 -13
- package/test/spec/modules/adriverIdSystem_spec.js +3 -8
- package/test/spec/modules/adtelligentBidAdapter_spec.js +2 -0
- package/test/spec/modules/adtrgtmeBidAdapter_spec.js +802 -0
- package/test/spec/modules/alkimiBidAdapter_spec.js +2 -1
- package/test/spec/modules/appnexusBidAdapter_spec.js +1 -0
- package/test/spec/modules/beopBidAdapter_spec.js +11 -0
- package/test/spec/modules/betweenBidAdapter_spec.js +17 -0
- package/test/spec/modules/bidwatchAnalyticsAdapter_spec.js +28 -12
- package/test/spec/modules/big-richmediaBidAdapter_spec.js +1 -0
- package/test/spec/modules/browsiRtdProvider_spec.js +40 -1
- package/test/spec/modules/consumableBidAdapter_spec.js +158 -0
- package/test/spec/modules/cpmstarBidAdapter_spec.js +1 -1
- package/test/spec/modules/criteoBidAdapter_spec.js +35 -26
- package/test/spec/modules/currency_spec.js +22 -0
- package/test/spec/modules/datawrkzBidAdapter_spec.js +656 -0
- package/test/spec/modules/dgkeywordRtdProvider_spec.js +1 -1
- package/test/spec/modules/displayioBidAdapter_spec.js +16 -52
- package/test/spec/modules/enrichmentFpdModule_spec.js +16 -1
- package/test/spec/modules/fpdModule_spec.js +2 -1
- package/test/spec/modules/id5IdSystem_spec.js +529 -172
- package/test/spec/modules/imRtdProvider_spec.js +10 -5
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +9 -13
- package/test/spec/modules/ixBidAdapter_spec.js +216 -123
- package/test/spec/modules/kargoBidAdapter_spec.js +11 -2
- package/test/spec/modules/lifestreetBidAdapter_spec.js +232 -0
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +59 -7
- package/test/spec/modules/mabidderBidAdapter_spec.js +125 -0
- package/test/spec/modules/mediagoBidAdapter_spec.js +97 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +2 -7
- package/test/spec/modules/oneKeyIdSystem_spec.js +107 -0
- package/test/spec/modules/oneKeyRtdProvider_spec.js +152 -0
- package/test/spec/modules/openxAnalyticsAdapter_spec.js +6 -638
- package/test/spec/modules/permutiveRtdProvider_spec.js +152 -2
- package/test/spec/modules/pubmaticBidAdapter_spec.js +69 -4
- package/test/spec/modules/rasBidAdapter_spec.js +2 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +18 -0
- package/test/spec/modules/trustpidSystem_spec.js +27 -45
- package/test/spec/modules/vidazooBidAdapter_spec.js +36 -23
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +59 -0
- package/test/spec/native_spec.js +257 -2
- package/test/spec/videoCache_spec.js +37 -7
|
@@ -5,9 +5,11 @@ import {
|
|
|
5
5
|
initSegments,
|
|
6
6
|
isAcEnabled,
|
|
7
7
|
isPermutiveOnPage,
|
|
8
|
-
setBidderRtb
|
|
8
|
+
setBidderRtb,
|
|
9
|
+
getModuleConfig,
|
|
10
|
+
PERMUTIVE_SUBMODULE_CONFIG_KEY,
|
|
9
11
|
} from 'modules/permutiveRtdProvider.js'
|
|
10
|
-
import { deepAccess } from '../../../src/utils.js'
|
|
12
|
+
import { deepAccess, deepSetValue, mergeDeep } from '../../../src/utils.js'
|
|
11
13
|
import { config } from 'src/config.js'
|
|
12
14
|
|
|
13
15
|
describe('permutiveRtdProvider', function () {
|
|
@@ -29,6 +31,154 @@ describe('permutiveRtdProvider', function () {
|
|
|
29
31
|
})
|
|
30
32
|
})
|
|
31
33
|
|
|
34
|
+
describe('getModuleConfig', function () {
|
|
35
|
+
beforeEach(function () {
|
|
36
|
+
// Reads data from the cache
|
|
37
|
+
permutiveSubmodule.init()
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const liftToParams = (params) => ({ params })
|
|
41
|
+
|
|
42
|
+
const getDefaultConfig = () => ({
|
|
43
|
+
waitForIt: false,
|
|
44
|
+
params: {
|
|
45
|
+
maxSegs: 500,
|
|
46
|
+
acBidders: [],
|
|
47
|
+
overwrites: {},
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const storeConfigInCacheAndInit = (data) => {
|
|
52
|
+
const dataToStore = { [PERMUTIVE_SUBMODULE_CONFIG_KEY]: data }
|
|
53
|
+
setLocalStorage(dataToStore)
|
|
54
|
+
// Reads data from the cache
|
|
55
|
+
permutiveSubmodule.init()
|
|
56
|
+
|
|
57
|
+
// Cleanup
|
|
58
|
+
return () => removeLocalStorage(dataToStore)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const setWindowPermutivePrebid = (getPermutiveRtdConfig) => {
|
|
62
|
+
// Read from Permutive
|
|
63
|
+
const backup = window.permutive
|
|
64
|
+
|
|
65
|
+
deepSetValue(window, 'permutive.addons.prebid', {
|
|
66
|
+
getPermutiveRtdConfig,
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
// Cleanup
|
|
70
|
+
return () => window.permutive = backup
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
it('should return default values', function () {
|
|
74
|
+
const config = getModuleConfig({})
|
|
75
|
+
expect(config).to.deep.equal(getDefaultConfig())
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('should override deeply on custom config', function () {
|
|
79
|
+
const defaultConfig = getDefaultConfig()
|
|
80
|
+
|
|
81
|
+
const customModuleConfig = { waitForIt: true, params: { acBidders: ['123'] } }
|
|
82
|
+
const config = getModuleConfig(customModuleConfig)
|
|
83
|
+
|
|
84
|
+
expect(config).to.deep.equal(mergeDeep(defaultConfig, customModuleConfig))
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
it('should override deeply on cached config', function () {
|
|
88
|
+
const defaultConfig = getDefaultConfig()
|
|
89
|
+
|
|
90
|
+
const cachedParamsConfig = { acBidders: ['123'] }
|
|
91
|
+
const cleanupCache = storeConfigInCacheAndInit(cachedParamsConfig)
|
|
92
|
+
|
|
93
|
+
const config = getModuleConfig({})
|
|
94
|
+
|
|
95
|
+
expect(config).to.deep.equal(mergeDeep(defaultConfig, liftToParams(cachedParamsConfig)))
|
|
96
|
+
|
|
97
|
+
// Cleanup
|
|
98
|
+
cleanupCache()
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
it('should override deeply on Permutive Rtd config', function () {
|
|
102
|
+
const defaultConfig = getDefaultConfig()
|
|
103
|
+
|
|
104
|
+
const permutiveRtdConfigParams = { acBidders: ['123'], overwrites: { '123': true } }
|
|
105
|
+
const cleanupPermutive = setWindowPermutivePrebid(function () {
|
|
106
|
+
return permutiveRtdConfigParams
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
const config = getModuleConfig({})
|
|
110
|
+
|
|
111
|
+
expect(config).to.deep.equal(mergeDeep(defaultConfig, liftToParams(permutiveRtdConfigParams)))
|
|
112
|
+
|
|
113
|
+
// Cleanup
|
|
114
|
+
cleanupPermutive()
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it('should NOT use cached Permutive Rtd config if window.permutive is available', function () {
|
|
118
|
+
const defaultConfig = getDefaultConfig()
|
|
119
|
+
|
|
120
|
+
// As Permutive is available on the window object, this value won't be used.
|
|
121
|
+
const cachedParamsConfig = { acBidders: ['123'] }
|
|
122
|
+
const cleanupCache = storeConfigInCacheAndInit(cachedParamsConfig)
|
|
123
|
+
|
|
124
|
+
const permutiveRtdConfigParams = { acBidders: ['456'], overwrites: { '123': true } }
|
|
125
|
+
const cleanupPermutive = setWindowPermutivePrebid(function () {
|
|
126
|
+
return permutiveRtdConfigParams
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
const config = getModuleConfig({})
|
|
130
|
+
|
|
131
|
+
expect(config).to.deep.equal(mergeDeep(defaultConfig, liftToParams(permutiveRtdConfigParams)))
|
|
132
|
+
|
|
133
|
+
// Cleanup
|
|
134
|
+
cleanupCache()
|
|
135
|
+
cleanupPermutive()
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
it('should handle calling Permutive method throwing error', function () {
|
|
139
|
+
const defaultConfig = getDefaultConfig()
|
|
140
|
+
|
|
141
|
+
const cleanupPermutive = setWindowPermutivePrebid(function () {
|
|
142
|
+
throw new Error()
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
const config = getModuleConfig({})
|
|
146
|
+
|
|
147
|
+
expect(config).to.deep.equal(defaultConfig)
|
|
148
|
+
|
|
149
|
+
// Cleanup
|
|
150
|
+
cleanupPermutive()
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('should override deeply in priority order', function () {
|
|
154
|
+
const defaultConfig = getDefaultConfig()
|
|
155
|
+
|
|
156
|
+
// As Permutive is available on the window object, this value won't be used.
|
|
157
|
+
const cachedConfig = { acBidders: ['123'] }
|
|
158
|
+
const cleanupCache = storeConfigInCacheAndInit(cachedConfig)
|
|
159
|
+
|
|
160
|
+
// Read from Permutive
|
|
161
|
+
const permutiveRtdConfig = { acBidders: ['456'] }
|
|
162
|
+
const cleanupPermutive = setWindowPermutivePrebid(function () {
|
|
163
|
+
return permutiveRtdConfig
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
const customModuleConfig = { params: { acBidders: ['789'], maxSegs: 499 } }
|
|
167
|
+
const config = getModuleConfig(customModuleConfig)
|
|
168
|
+
|
|
169
|
+
// The configs are in reverse priority order as configs are merged left to right. So the priority is,
|
|
170
|
+
// 1. customModuleConfig <- set by publisher with pbjs.setConfig
|
|
171
|
+
// 2. permutiveRtdConfig <- set by the publisher using Permutive.
|
|
172
|
+
// 3. defaultConfig
|
|
173
|
+
const configMergedInPriorityOrder = mergeDeep(defaultConfig, liftToParams(permutiveRtdConfig), customModuleConfig)
|
|
174
|
+
expect(config).to.deep.equal(configMergedInPriorityOrder)
|
|
175
|
+
|
|
176
|
+
// Cleanup
|
|
177
|
+
cleanupCache()
|
|
178
|
+
cleanupPermutive()
|
|
179
|
+
})
|
|
180
|
+
})
|
|
181
|
+
|
|
32
182
|
describe('ortb2 config', function () {
|
|
33
183
|
beforeEach(function () {
|
|
34
184
|
config.resetConfig()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {expect} from 'chai';
|
|
2
|
-
import {spec, checkVideoPlacement} from 'modules/pubmaticBidAdapter.js';
|
|
2
|
+
import {spec, checkVideoPlacement, _getDomainFromURL} 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';
|
|
@@ -1103,8 +1103,24 @@ describe('PubMatic adapter', function () {
|
|
|
1103
1103
|
expect(data.imp[0].ext.key_val).to.exist.and.to.equal(bidRequests[0].params.dctr);
|
|
1104
1104
|
expect(data.imp[0].bidfloorcur).to.equal(bidRequests[0].params.currency);
|
|
1105
1105
|
expect(data.source.ext.schain).to.deep.equal(bidRequests[0].schain);
|
|
1106
|
+
expect(data.ext.epoch).to.exist;
|
|
1106
1107
|
});
|
|
1107
1108
|
|
|
1109
|
+
it('Set tmax from global config if not set by requestBids method', function() {
|
|
1110
|
+
let sandbox = sinon.sandbox.create();
|
|
1111
|
+
sandbox.stub(config, 'getConfig').callsFake((key) => {
|
|
1112
|
+
var config = {
|
|
1113
|
+
bidderTimeout: 3000
|
|
1114
|
+
};
|
|
1115
|
+
return config[key];
|
|
1116
|
+
});
|
|
1117
|
+
let request = spec.buildRequests(bidRequests, {
|
|
1118
|
+
auctionId: 'new-auction-id', timeout: 3000
|
|
1119
|
+
});
|
|
1120
|
+
let data = JSON.parse(request.data);
|
|
1121
|
+
expect(data.tmax).to.deep.equal(3000);
|
|
1122
|
+
sandbox.restore();
|
|
1123
|
+
});
|
|
1108
1124
|
describe('Marketplace parameters', function() {
|
|
1109
1125
|
let bidderSettingStub;
|
|
1110
1126
|
beforeEach(function() {
|
|
@@ -1688,17 +1704,66 @@ describe('PubMatic adapter', function () {
|
|
|
1688
1704
|
describe('FPD', function() {
|
|
1689
1705
|
let newRequest;
|
|
1690
1706
|
|
|
1691
|
-
|
|
1707
|
+
describe('ortb2.site should not override page, domain & ref values', function() {
|
|
1708
|
+
it('When above properties are present in ortb2.site', function() {
|
|
1709
|
+
const ortb2 = {
|
|
1710
|
+
site: {
|
|
1711
|
+
domain: 'page.example.com',
|
|
1712
|
+
page: 'https://page.example.com/here.html',
|
|
1713
|
+
ref: 'https://page.example.com/here.html'
|
|
1714
|
+
}
|
|
1715
|
+
};
|
|
1716
|
+
const request = spec.buildRequests(bidRequests, {ortb2});
|
|
1717
|
+
let data = JSON.parse(request.data);
|
|
1718
|
+
expect(data.site.domain).not.equal('page.example.com');
|
|
1719
|
+
expect(data.site.page).not.equal('https://page.example.com/here.html');
|
|
1720
|
+
expect(data.site.ref).not.equal('https://page.example.com/here.html');
|
|
1721
|
+
});
|
|
1722
|
+
|
|
1723
|
+
it('When above properties are absent in ortb2.site', function () {
|
|
1724
|
+
const ortb2 = {
|
|
1725
|
+
site: {}
|
|
1726
|
+
};
|
|
1727
|
+
let request = spec.buildRequests(bidRequests, {
|
|
1728
|
+
auctionId: 'new-auction-id',
|
|
1729
|
+
ortb2
|
|
1730
|
+
});
|
|
1731
|
+
let data = JSON.parse(request.data);
|
|
1732
|
+
let response = spec.interpretResponse(bidResponses, request);
|
|
1733
|
+
expect(data.site.page).to.equal(bidRequests[0].params.kadpageurl);
|
|
1734
|
+
expect(data.site.domain).to.equal(_getDomainFromURL(data.site.page));
|
|
1735
|
+
expect(response[0].referrer).to.equal(data.site.ref);
|
|
1736
|
+
});
|
|
1737
|
+
|
|
1738
|
+
it('With some extra properties in ortb2.site', function() {
|
|
1739
|
+
const ortb2 = {
|
|
1740
|
+
site: {
|
|
1741
|
+
domain: 'page.example.com',
|
|
1742
|
+
page: 'https://page.example.com/here.html',
|
|
1743
|
+
ref: 'https://page.example.com/here.html',
|
|
1744
|
+
cat: ['IAB2'],
|
|
1745
|
+
sectioncat: ['IAB2-2']
|
|
1746
|
+
}
|
|
1747
|
+
};
|
|
1748
|
+
const request = spec.buildRequests(bidRequests, {ortb2});
|
|
1749
|
+
let data = JSON.parse(request.data);
|
|
1750
|
+
expect(data.site.domain).not.equal('page.example.com');
|
|
1751
|
+
expect(data.site.page).not.equal('https://page.example.com/here.html');
|
|
1752
|
+
expect(data.site.ref).not.equal('https://page.example.com/here.html');
|
|
1753
|
+
expect(data.site.cat).to.deep.equal(['IAB2']);
|
|
1754
|
+
expect(data.site.sectioncat).to.deep.equal(['IAB2-2']);
|
|
1755
|
+
});
|
|
1756
|
+
});
|
|
1757
|
+
|
|
1758
|
+
it('ortb2.site should be merged except page, domain & ref in the request', function() {
|
|
1692
1759
|
const ortb2 = {
|
|
1693
1760
|
site: {
|
|
1694
|
-
domain: 'page.example.com',
|
|
1695
1761
|
cat: ['IAB2'],
|
|
1696
1762
|
sectioncat: ['IAB2-2']
|
|
1697
1763
|
}
|
|
1698
1764
|
};
|
|
1699
1765
|
const request = spec.buildRequests(bidRequests, {ortb2});
|
|
1700
1766
|
let data = JSON.parse(request.data);
|
|
1701
|
-
expect(data.site.domain).to.equal('page.example.com');
|
|
1702
1767
|
expect(data.site.cat).to.deep.equal(['IAB2']);
|
|
1703
1768
|
expect(data.site.sectioncat).to.deep.equal(['IAB2-2']);
|
|
1704
1769
|
});
|
|
@@ -58,6 +58,7 @@ describe('rasBidAdapter', function () {
|
|
|
58
58
|
slot: 'test',
|
|
59
59
|
area: 'areatest',
|
|
60
60
|
site: 'test',
|
|
61
|
+
slotSequence: '0',
|
|
61
62
|
network: '4178463'
|
|
62
63
|
}
|
|
63
64
|
};
|
|
@@ -140,6 +141,7 @@ describe('rasBidAdapter', function () {
|
|
|
140
141
|
expect(requests[0].url).to.have.string('DV=test%2Fareatest');
|
|
141
142
|
expect(requests[0].url).to.have.string('kwrd=val1%2Bval2');
|
|
142
143
|
expect(requests[0].url).to.have.string('kvadunit=test%2Fareatest');
|
|
144
|
+
expect(requests[0].url).to.have.string('pos0=0');
|
|
143
145
|
});
|
|
144
146
|
});
|
|
145
147
|
|
|
@@ -714,6 +714,24 @@ describe('triplelift adapter', function () {
|
|
|
714
714
|
expect(payload.user).to.deep.equal({ext: {eids: [{source: 'criteo.com', uids: [{id, ext: {rtiPartner: 'criteoId'}}]}]}});
|
|
715
715
|
});
|
|
716
716
|
|
|
717
|
+
it('should add adqueryId to the payload if included', function () {
|
|
718
|
+
const id = '%7B%22qid%22%3A%229c985f8cc31d9b3c000d%22%7D';
|
|
719
|
+
bidRequests[0].userIdAsEids = [{ source: 'adquery.io', uids: [{ id }] }];
|
|
720
|
+
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
|
|
721
|
+
const payload = request.data;
|
|
722
|
+
expect(payload).to.exist;
|
|
723
|
+
expect(payload.user).to.deep.equal({ext: {eids: [{source: 'adquery.io', uids: [{id, ext: {rtiPartner: 'adquery.io'}}]}]}});
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
it('should add amxRtbId to the payload if included', function () {
|
|
727
|
+
const id = 'Ok9JQkBM-UFlAXEZQ-UUNBQlZOQzgrUFhW-UUNBQkRQTUBPQVpVWVxNXlZUUF9AUFhAUF9PXFY/';
|
|
728
|
+
bidRequests[0].userIdAsEids = [{ source: 'amxrtb.com', uids: [{ id }] }];
|
|
729
|
+
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
|
|
730
|
+
const payload = request.data;
|
|
731
|
+
expect(payload).to.exist;
|
|
732
|
+
expect(payload.user).to.deep.equal({ext: {eids: [{source: 'amxrtb.com', uids: [{id, ext: {rtiPartner: 'amxrtb.com'}}]}]}});
|
|
733
|
+
});
|
|
734
|
+
|
|
717
735
|
it('should add tdid, idl_env and criteoId to the payload if both are included', function () {
|
|
718
736
|
const tdidId = '6bca7f6b-a98a-46c0-be05-6020f7604598';
|
|
719
737
|
const idlEnvId = 'XY6104gr0njcH9UDIR7ysFFJcm2XNpqeJTYslleJ_cMlsFOfZI';
|
|
@@ -22,14 +22,6 @@ describe('trustpid System', () => {
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
describe('trustpid getId()', () => {
|
|
25
|
-
before(() => {
|
|
26
|
-
window.FC_CONF = {
|
|
27
|
-
TELCO_ACRONYM: {
|
|
28
|
-
'domain.with.acronym': 'acronymValue',
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
25
|
afterEach(() => {
|
|
34
26
|
storage.removeDataFromLocalStorage(connectDataKey);
|
|
35
27
|
storage.removeDataFromLocalStorage(connectDomainKey);
|
|
@@ -52,7 +44,7 @@ describe('trustpid System', () => {
|
|
|
52
44
|
it('tests if localstorage & JSON works properly ', () => {
|
|
53
45
|
const idGraph = {
|
|
54
46
|
'domain': 'domainValue',
|
|
55
|
-
'
|
|
47
|
+
'atid': 'atidValue',
|
|
56
48
|
};
|
|
57
49
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
58
50
|
expect(JSON.parse(storage.getDataFromLocalStorage(connectDataKey))).to.have.property('connectId');
|
|
@@ -61,7 +53,7 @@ describe('trustpid System', () => {
|
|
|
61
53
|
it('returns {callback: func} if domains don\'t match', () => {
|
|
62
54
|
const idGraph = {
|
|
63
55
|
'domain': 'domainValue',
|
|
64
|
-
'
|
|
56
|
+
'atid': 'atidValue',
|
|
65
57
|
};
|
|
66
58
|
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('differentDomainValue'));
|
|
67
59
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
@@ -70,33 +62,33 @@ describe('trustpid System', () => {
|
|
|
70
62
|
|
|
71
63
|
it('returns {id: {trustpid: data.trustpid}} if we have the right data stored in the localstorage ', () => {
|
|
72
64
|
const idGraph = {
|
|
73
|
-
'domain': 'domain
|
|
74
|
-
'
|
|
65
|
+
'domain': 'test.domain',
|
|
66
|
+
'atid': 'atidValue',
|
|
75
67
|
};
|
|
76
|
-
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('domain
|
|
68
|
+
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('test.domain'));
|
|
77
69
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
78
70
|
const response = trustpidSubmodule.getId();
|
|
79
71
|
expect(response).to.have.property('id');
|
|
80
72
|
expect(response.id).to.have.property('trustpid');
|
|
81
|
-
expect(response.id.trustpid).to.be.equal('
|
|
73
|
+
expect(response.id.trustpid).to.be.equal('atidValue');
|
|
82
74
|
});
|
|
83
75
|
|
|
84
76
|
it('returns {trustpid: data.trustpid} if we have the right data stored in the localstorage right after the callback is called', (done) => {
|
|
85
77
|
const idGraph = {
|
|
86
|
-
'domain': 'domain
|
|
87
|
-
'
|
|
78
|
+
'domain': 'test.domain',
|
|
79
|
+
'atid': 'atidValue',
|
|
88
80
|
};
|
|
89
81
|
const response = trustpidSubmodule.getId();
|
|
90
82
|
expect(response).to.have.property('callback');
|
|
91
83
|
expect(response.callback.toString()).contain('result(callback)');
|
|
92
84
|
|
|
93
85
|
if (typeof response.callback === 'function') {
|
|
94
|
-
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('domain
|
|
86
|
+
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('test.domain'));
|
|
95
87
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
96
88
|
response.callback(function (result) {
|
|
97
89
|
expect(result).to.not.be.null;
|
|
98
90
|
expect(result).to.have.property('trustpid');
|
|
99
|
-
expect(result.trustpid).to.be.equal('
|
|
91
|
+
expect(result.trustpid).to.be.equal('atidValue');
|
|
100
92
|
done()
|
|
101
93
|
})
|
|
102
94
|
}
|
|
@@ -104,8 +96,8 @@ describe('trustpid System', () => {
|
|
|
104
96
|
|
|
105
97
|
it('returns null if domains don\'t match', (done) => {
|
|
106
98
|
const idGraph = {
|
|
107
|
-
'domain': 'domain
|
|
108
|
-
'
|
|
99
|
+
'domain': 'test.domain',
|
|
100
|
+
'atid': 'atidValue',
|
|
109
101
|
};
|
|
110
102
|
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('differentDomainValue'));
|
|
111
103
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
@@ -127,8 +119,8 @@ describe('trustpid System', () => {
|
|
|
127
119
|
|
|
128
120
|
it('returns {trustpid: data.trustpid} if we have the right data stored in the localstorage right after 500ms delay', (done) => {
|
|
129
121
|
const idGraph = {
|
|
130
|
-
'domain': 'domain
|
|
131
|
-
'
|
|
122
|
+
'domain': 'test.domain',
|
|
123
|
+
'atid': 'atidValue',
|
|
132
124
|
};
|
|
133
125
|
|
|
134
126
|
const response = trustpidSubmodule.getId();
|
|
@@ -137,13 +129,13 @@ describe('trustpid System', () => {
|
|
|
137
129
|
|
|
138
130
|
if (typeof response.callback === 'function') {
|
|
139
131
|
setTimeout(() => {
|
|
140
|
-
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('domain
|
|
132
|
+
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('test.domain'));
|
|
141
133
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
142
134
|
}, 500);
|
|
143
135
|
response.callback(function (result) {
|
|
144
136
|
expect(result).to.not.be.null;
|
|
145
137
|
expect(result).to.have.property('trustpid');
|
|
146
|
-
expect(result.trustpid).to.be.equal('
|
|
138
|
+
expect(result.trustpid).to.be.equal('atidValue');
|
|
147
139
|
done()
|
|
148
140
|
})
|
|
149
141
|
}
|
|
@@ -151,8 +143,8 @@ describe('trustpid System', () => {
|
|
|
151
143
|
|
|
152
144
|
it('returns null if we have the data stored in the localstorage after 500ms delay and the max (waiting) delay is only 200ms ', (done) => {
|
|
153
145
|
const idGraph = {
|
|
154
|
-
'domain': 'domain
|
|
155
|
-
'
|
|
146
|
+
'domain': 'test.domain',
|
|
147
|
+
'atid': 'atidValue',
|
|
156
148
|
};
|
|
157
149
|
|
|
158
150
|
const response = trustpidSubmodule.getId({params: {maxDelayTime: 200}});
|
|
@@ -161,7 +153,7 @@ describe('trustpid System', () => {
|
|
|
161
153
|
|
|
162
154
|
if (typeof response.callback === 'function') {
|
|
163
155
|
setTimeout(() => {
|
|
164
|
-
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('domain
|
|
156
|
+
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify('test.domain'));
|
|
165
157
|
storage.setDataInLocalStorage(connectDataKey, JSON.stringify(getStorageData(idGraph)));
|
|
166
158
|
}, 500);
|
|
167
159
|
response.callback(function (result) {
|
|
@@ -202,17 +194,7 @@ describe('trustpid System', () => {
|
|
|
202
194
|
});
|
|
203
195
|
});
|
|
204
196
|
|
|
205
|
-
describe('trustpid messageHandler
|
|
206
|
-
before(() => {
|
|
207
|
-
window.FC_CONF = {
|
|
208
|
-
TELCO_ACRONYM: {
|
|
209
|
-
'domain1': 'abcd',
|
|
210
|
-
'domain2': 'efgh',
|
|
211
|
-
'domain3': 'ijkl',
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
});
|
|
215
|
-
|
|
197
|
+
describe('trustpid messageHandler', () => {
|
|
216
198
|
afterEach(() => {
|
|
217
199
|
storage.removeDataFromLocalStorage(connectDataKey);
|
|
218
200
|
storage.removeDataFromLocalStorage(connectDomainKey);
|
|
@@ -223,16 +205,16 @@ describe('trustpid System', () => {
|
|
|
223
205
|
})
|
|
224
206
|
|
|
225
207
|
const domains = [
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
208
|
+
'domain1',
|
|
209
|
+
'domain2',
|
|
210
|
+
'domain3',
|
|
229
211
|
];
|
|
230
212
|
|
|
231
|
-
domains.forEach(
|
|
232
|
-
it(`correctly sets trustpid value
|
|
213
|
+
domains.forEach(domain => {
|
|
214
|
+
it(`correctly sets trustpid value for domain name ${domain}`, (done) => {
|
|
233
215
|
const idGraph = {
|
|
234
216
|
'domain': domain,
|
|
235
|
-
'
|
|
217
|
+
'atid': 'atidValue',
|
|
236
218
|
};
|
|
237
219
|
|
|
238
220
|
storage.setDataInLocalStorage(connectDomainKey, JSON.stringify(domain));
|
|
@@ -247,7 +229,7 @@ describe('trustpid System', () => {
|
|
|
247
229
|
const response = trustpidSubmodule.getId();
|
|
248
230
|
expect(response).to.have.property('id');
|
|
249
231
|
expect(response.id).to.have.property('trustpid');
|
|
250
|
-
expect(response.id.trustpid).to.be.equal(
|
|
232
|
+
expect(response.id.trustpid).to.be.equal('atidValue');
|
|
251
233
|
done();
|
|
252
234
|
});
|
|
253
235
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {expect} from 'chai';
|
|
2
2
|
import {
|
|
3
3
|
spec as adapter,
|
|
4
4
|
SUPPORTED_ID_SYSTEMS,
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
getVidazooSessionId,
|
|
16
16
|
} from 'modules/vidazooBidAdapter.js';
|
|
17
17
|
import * as utils from 'src/utils.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import {version} from 'package.json';
|
|
19
|
+
import {useFakeTimers} from 'sinon';
|
|
20
20
|
|
|
21
21
|
const SUB_DOMAIN = 'openrtb';
|
|
22
22
|
|
|
@@ -55,6 +55,7 @@ const BIDDER_REQUEST = {
|
|
|
55
55
|
|
|
56
56
|
const SERVER_RESPONSE = {
|
|
57
57
|
body: {
|
|
58
|
+
cid: 'testcid123',
|
|
58
59
|
results: [{
|
|
59
60
|
'ad': '<iframe>console.log("hello world")</iframe>',
|
|
60
61
|
'price': 0.8,
|
|
@@ -84,7 +85,7 @@ const REQUEST = {
|
|
|
84
85
|
|
|
85
86
|
function getTopWindowQueryParams() {
|
|
86
87
|
try {
|
|
87
|
-
const parsedUrl = utils.parseUrl(window.top.document.URL, {
|
|
88
|
+
const parsedUrl = utils.parseUrl(window.top.document.URL, {decodeSearchAsString: true});
|
|
88
89
|
return parsedUrl.search;
|
|
89
90
|
} catch (e) {
|
|
90
91
|
return '';
|
|
@@ -196,19 +197,27 @@ describe('VidazooBidAdapter', function () {
|
|
|
196
197
|
});
|
|
197
198
|
describe('getUserSyncs', function () {
|
|
198
199
|
it('should have valid user sync with iframeEnabled', function () {
|
|
199
|
-
const result = adapter.getUserSyncs({
|
|
200
|
+
const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
|
|
200
201
|
|
|
201
202
|
expect(result).to.deep.equal([{
|
|
202
203
|
type: 'iframe',
|
|
203
|
-
url: 'https://
|
|
204
|
+
url: 'https://sync.cootlogix.com/api/sync/iframe/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy='
|
|
205
|
+
}]);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('should have valid user sync with cid on response', function () {
|
|
209
|
+
const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
|
|
210
|
+
expect(result).to.deep.equal([{
|
|
211
|
+
type: 'iframe',
|
|
212
|
+
url: 'https://sync.cootlogix.com/api/sync/iframe/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy='
|
|
204
213
|
}]);
|
|
205
214
|
});
|
|
206
215
|
|
|
207
216
|
it('should have valid user sync with pixelEnabled', function () {
|
|
208
|
-
const result = adapter.getUserSyncs({
|
|
217
|
+
const result = adapter.getUserSyncs({pixelEnabled: true}, [SERVER_RESPONSE]);
|
|
209
218
|
|
|
210
219
|
expect(result).to.deep.equal([{
|
|
211
|
-
'url': 'https://
|
|
220
|
+
'url': 'https://sync.cootlogix.com/api/sync/image/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy=',
|
|
212
221
|
'type': 'image'
|
|
213
222
|
}]);
|
|
214
223
|
})
|
|
@@ -221,12 +230,12 @@ describe('VidazooBidAdapter', function () {
|
|
|
221
230
|
});
|
|
222
231
|
|
|
223
232
|
it('should return empty array when there is no ad', function () {
|
|
224
|
-
const responses = adapter.interpretResponse({
|
|
233
|
+
const responses = adapter.interpretResponse({price: 1, ad: ''});
|
|
225
234
|
expect(responses).to.be.empty;
|
|
226
235
|
});
|
|
227
236
|
|
|
228
237
|
it('should return empty array when there is no price', function () {
|
|
229
|
-
const responses = adapter.interpretResponse({
|
|
238
|
+
const responses = adapter.interpretResponse({price: null, ad: 'great ad'});
|
|
230
239
|
expect(responses).to.be.empty;
|
|
231
240
|
});
|
|
232
241
|
|
|
@@ -265,10 +274,14 @@ describe('VidazooBidAdapter', function () {
|
|
|
265
274
|
|
|
266
275
|
const userId = (function () {
|
|
267
276
|
switch (idSystemProvider) {
|
|
268
|
-
case 'lipb':
|
|
269
|
-
|
|
270
|
-
case '
|
|
271
|
-
|
|
277
|
+
case 'lipb':
|
|
278
|
+
return {lipbid: id};
|
|
279
|
+
case 'parrableId':
|
|
280
|
+
return {eid: id};
|
|
281
|
+
case 'id5id':
|
|
282
|
+
return {uid: id};
|
|
283
|
+
default:
|
|
284
|
+
return id;
|
|
272
285
|
}
|
|
273
286
|
})();
|
|
274
287
|
|
|
@@ -285,18 +298,18 @@ describe('VidazooBidAdapter', function () {
|
|
|
285
298
|
|
|
286
299
|
describe('alternate param names extractors', function () {
|
|
287
300
|
it('should return undefined when param not supported', function () {
|
|
288
|
-
const cid = extractCID({
|
|
289
|
-
const pid = extractPID({
|
|
290
|
-
const subDomain = extractSubDomain({
|
|
301
|
+
const cid = extractCID({'c_id': '1'});
|
|
302
|
+
const pid = extractPID({'p_id': '1'});
|
|
303
|
+
const subDomain = extractSubDomain({'sub_domain': 'prebid'});
|
|
291
304
|
expect(cid).to.be.undefined;
|
|
292
305
|
expect(pid).to.be.undefined;
|
|
293
306
|
expect(subDomain).to.be.undefined;
|
|
294
307
|
});
|
|
295
308
|
|
|
296
309
|
it('should return value when param supported', function () {
|
|
297
|
-
const cid = extractCID({
|
|
298
|
-
const pid = extractPID({
|
|
299
|
-
const subDomain = extractSubDomain({
|
|
310
|
+
const cid = extractCID({'cID': '1'});
|
|
311
|
+
const pid = extractPID({'Pid': '2'});
|
|
312
|
+
const subDomain = extractSubDomain({'subDOMAIN': 'prebid'});
|
|
300
313
|
expect(cid).to.be.equal('1');
|
|
301
314
|
expect(pid).to.be.equal('2');
|
|
302
315
|
expect(subDomain).to.be.equal('prebid');
|
|
@@ -409,7 +422,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
409
422
|
now
|
|
410
423
|
});
|
|
411
424
|
setStorageItem('myKey', 2020);
|
|
412
|
-
const {
|
|
425
|
+
const {value, created} = getStorageItem('myKey');
|
|
413
426
|
expect(created).to.be.equal(now);
|
|
414
427
|
expect(value).to.be.equal(2020);
|
|
415
428
|
expect(typeof value).to.be.equal('number');
|
|
@@ -425,8 +438,8 @@ describe('VidazooBidAdapter', function () {
|
|
|
425
438
|
});
|
|
426
439
|
|
|
427
440
|
it('should parse JSON value', function () {
|
|
428
|
-
const data = JSON.stringify({
|
|
429
|
-
const {
|
|
441
|
+
const data = JSON.stringify({event: 'send'});
|
|
442
|
+
const {event} = tryParseJSON(data);
|
|
430
443
|
expect(event).to.be.equal('send');
|
|
431
444
|
});
|
|
432
445
|
|