prebid.js 7.22.0 → 7.24.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/33acrossBidAdapter.js +1 -1
- package/dist/aaxBlockmeterRtdProvider.js +1 -0
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admaticBidAdapter.js +1 -0
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.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/audiencerunBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidViewability.js +1 -1
- package/dist/bidViewabilityIO.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -0
- package/dist/cleanioRtdProvider.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.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/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/dependencies.json +19 -0
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/gdprEnforcement.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/googleAnalyticsAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/growthCodeIdSystem.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.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/instreamTracking.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerVideoProvider.js +1 -0
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -0
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.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/mediakeysBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/mgidRtdProvider.js +1 -0
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/multibid.js +1 -1
- package/dist/not-for-prod/prebid.js +153 -141
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxOrtbBidAdapter.js +1 -1
- package/dist/ortbConverter.js +1 -0
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionRtdProvider.js +1 -0
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pbsExtensions.js +1 -0
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/pubCommonId.js +1 -1
- package/dist/publinkIdSystem.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/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rtdModule.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/schain.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/spotxBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/teadsIdSystem.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/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/video.js +1 -0
- package/dist/videoModule.js +1 -0
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/videojsVideoProvider.js +1 -0
- 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/integrationExamples/gpt/mgidRtdProvider_example.html +143 -0
- package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +98 -0
- package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +89 -0
- package/integrationExamples/videoModule/jwplayer/eventListeners.html +244 -0
- package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +122 -0
- package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +80 -0
- package/integrationExamples/videoModule/jwplayer/playlist.html +122 -0
- package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +126 -0
- package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +132 -0
- package/integrationExamples/videoModule/videojs/eventListeners.html +238 -0
- package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +138 -0
- package/integrationExamples/videoModule/videojs/mediaMetadata.html +103 -0
- package/integrationExamples/videoModule/videojs/playlist.html +151 -0
- package/libraries/ortbConverter/README.md +378 -0
- package/libraries/ortbConverter/converter.js +135 -0
- package/libraries/ortbConverter/lib/composer.js +43 -0
- package/libraries/ortbConverter/lib/mergeProcessors.js +9 -0
- package/libraries/ortbConverter/lib/sizes.js +14 -0
- package/libraries/ortbConverter/processors/banner.js +40 -0
- package/libraries/ortbConverter/processors/default.js +167 -0
- package/libraries/ortbConverter/processors/mediaType.js +21 -0
- package/libraries/ortbConverter/processors/native.js +37 -0
- package/libraries/ortbConverter/processors/video.js +66 -0
- package/libraries/pbsExtensions/pbsExtensions.js +12 -0
- package/libraries/pbsExtensions/processors/aliases.js +17 -0
- package/libraries/pbsExtensions/processors/mediaType.js +23 -0
- package/libraries/pbsExtensions/processors/params.js +22 -0
- package/libraries/pbsExtensions/processors/pbs.js +99 -0
- package/libraries/pbsExtensions/processors/requestExtPrebid.js +30 -0
- package/libraries/pbsExtensions/processors/video.js +23 -0
- package/libraries/video/constants/enums.js +5 -0
- package/libraries/video/constants/events.js +97 -0
- package/libraries/video/constants/ortb.js +169 -0
- package/libraries/video/constants/vendorCodes.js +6 -0
- package/libraries/video/shared/eventHandler.js +18 -0
- package/libraries/video/shared/parentModule.js +82 -0
- package/libraries/video/shared/state.js +47 -0
- package/libraries/video/shared/vastXmlBuilder.js +77 -0
- package/libraries/video/shared/vastXmlEditor.js +115 -0
- package/modules/.submodules.json +7 -1
- package/modules/aaxBlockmeterRtdProvider.js +59 -0
- package/modules/aaxBlockmeterRtdProvider.md +48 -0
- package/modules/admaticBidAdapter.js +147 -0
- package/modules/admaticBidAdapter.md +48 -0
- package/modules/amxBidAdapter.js +1 -0
- package/modules/appnexusBidAdapter.js +38 -1
- package/modules/chtnwBidAdapter.js +110 -0
- package/modules/chtnwBidAdapter.md +31 -0
- package/modules/concertBidAdapter.js +44 -2
- package/modules/connectIdSystem.js +36 -23
- package/modules/connectIdSystem.md +3 -2
- package/modules/consentManagement.js +22 -1
- package/modules/consentManagementUsp.js +29 -7
- package/modules/criteoBidAdapter.js +25 -5
- package/modules/currency.js +9 -0
- package/modules/dgkeywordRtdProvider.js +3 -3
- package/modules/gridNMBidAdapter.js +10 -14
- package/modules/growthCodeIdSystem.js +9 -5
- package/modules/gumgumBidAdapter.js +4 -0
- package/modules/improvedigitalBidAdapter.js +191 -470
- package/modules/ixBidAdapter.js +54 -71
- package/modules/jwplayerVideoProvider.js +929 -0
- package/modules/jwplayerVideoProvider.md +25 -0
- package/modules/kargoBidAdapter.js +1 -1
- package/modules/kueezRtbBidAdapter.js +278 -0
- package/modules/kueezRtbBidAdapter.md +35 -0
- package/modules/magniteAnalyticsAdapter.js +6 -1
- package/modules/mgidRtdProvider.js +190 -0
- package/modules/mgidRtdProvider.md +51 -0
- package/modules/multibid/index.js +12 -0
- package/modules/openxOrtbBidAdapter.js +120 -275
- package/modules/oxxionRtdProvider.js +119 -0
- package/modules/oxxionRtdProvider.md +48 -0
- package/modules/permutiveRtdProvider.js +2 -1
- package/modules/permutiveRtdProvider.md +36 -1
- package/modules/prebidServerBidAdapter/index.js +19 -716
- package/modules/prebidServerBidAdapter/ortbConverter.js +274 -0
- package/modules/priceFloors.js +73 -1
- package/modules/pubmaticBidAdapter.js +21 -29
- package/modules/rtdModule/index.js +22 -1
- package/modules/schain.js +24 -1
- package/modules/spotxBidAdapter.js +16 -15
- package/modules/synacormediaBidAdapter.js +1 -1
- package/modules/teadsIdSystem.js +5 -0
- package/modules/tripleliftBidAdapter.js +1 -1
- package/modules/userId/eids.js +3 -10
- package/modules/userId/index.js +64 -6
- package/modules/videoModule/addingSubmodule.md +521 -0
- package/modules/videoModule/coreVideo.js +234 -0
- package/modules/videoModule/gamAdServerSubmodule.js +27 -0
- package/modules/videoModule/index.js +244 -0
- package/modules/videoModule/videoImpressionVerifier.js +206 -0
- package/modules/videojsVideoProvider.js +854 -0
- package/modules/videojsVideoProvider.md +17 -0
- package/package.json +12 -8
- package/src/adRendering.js +1 -1
- package/src/adapterManager.js +56 -7
- package/src/adloader.js +3 -1
- package/src/auction.js +6 -1
- package/src/events.js +5 -1
- package/src/pbjsORTB.js +35 -0
- package/src/prebid.js +137 -112
- package/src/targeting.js +10 -2
- package/src/utils/currency.js +16 -0
- package/src/utils.js +21 -0
- package/test/spec/auctionmanager_spec.js +15 -0
- package/test/spec/modules/aaxBlockmeter_spec.js +58 -0
- package/test/spec/modules/admaticBidAdapter_spec.js +46 -0
- package/test/spec/modules/chtnwBidAdapter_spec.js +105 -0
- package/test/spec/modules/concertBidAdapter_spec.js +56 -0
- package/test/spec/modules/connectIdSystem_spec.js +175 -5
- package/test/spec/modules/consentManagementUsp_spec.js +64 -18
- package/test/spec/modules/criteoBidAdapter_spec.js +28 -0
- package/test/spec/modules/dgkeywordRtdProvider_spec.js +3 -3
- package/test/spec/modules/eids_spec.js +10 -7
- package/test/spec/modules/ftrackIdSystem_spec.js +34 -22
- package/test/spec/modules/gumgumBidAdapter_spec.js +15 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +231 -211
- package/test/spec/modules/ixBidAdapter_spec.js +412 -350
- package/test/spec/modules/kueezRtbBidAdapter_spec.js +396 -0
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +26 -0
- package/test/spec/modules/mgidRtdProvider_spec.js +366 -0
- package/test/spec/modules/openxOrtbBidAdapter_spec.js +77 -49
- package/test/spec/modules/oxxionRtdProvider_spec.js +142 -0
- package/test/spec/modules/permutiveRtdProvider_spec.js +64 -5
- package/test/spec/modules/prebidServerBidAdapter_spec.js +139 -137
- package/test/spec/modules/realTimeDataModule_spec.js +65 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +14 -0
- package/test/spec/modules/userId_spec.js +67 -1
- package/test/spec/modules/videoModule/coreVideo_spec.js +98 -0
- package/test/spec/modules/videoModule/pbVideo_spec.js +362 -0
- package/test/spec/modules/videoModule/shared/parentModule_spec.js +73 -0
- package/test/spec/modules/videoModule/shared/state_spec.js +26 -0
- package/test/spec/modules/videoModule/shared/vastXmlBuilder_spec.js +103 -0
- package/test/spec/modules/videoModule/shared/vastXmlEditor_spec.js +209 -0
- package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +846 -0
- package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +391 -0
- package/test/spec/modules/videoModule/videoImpressionVerifier_spec.js +112 -0
- package/test/spec/ortbConverter/banner_spec.js +203 -0
- package/test/spec/ortbConverter/composer_spec.js +69 -0
- package/test/spec/ortbConverter/converter_spec.js +283 -0
- package/test/spec/ortbConverter/currency_spec.js +40 -0
- package/test/spec/ortbConverter/default_processors_spec.js +61 -0
- package/test/spec/ortbConverter/gdpr_spec.js +38 -0
- package/test/spec/ortbConverter/mediaTypes_spec.js +67 -0
- package/test/spec/ortbConverter/mergeProcessors_spec.js +59 -0
- package/test/spec/ortbConverter/multibid_spec.js +35 -0
- package/test/spec/ortbConverter/native_spec.js +95 -0
- package/test/spec/ortbConverter/pbjsORTB_spec.js +67 -0
- package/test/spec/ortbConverter/pbsExtensions/aliases_spec.js +57 -0
- package/test/spec/ortbConverter/pbsExtensions/params_spec.js +96 -0
- package/test/spec/ortbConverter/pbsExtensions/video_spec.js +52 -0
- package/test/spec/ortbConverter/priceFloors_spec.js +143 -0
- package/test/spec/ortbConverter/schain_spec.js +33 -0
- package/test/spec/ortbConverter/userId_spec.js +21 -0
- package/test/spec/ortbConverter/usp_spec.js +15 -0
- package/test/spec/ortbConverter/video_spec.js +189 -0
- package/test/spec/unit/core/adapterManager_spec.js +102 -0
- package/test/spec/unit/core/targeting_spec.js +34 -0
- package/test/spec/unit/pbjs_api_spec.js +124 -45
- package/test/spec/utils_spec.js +45 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { buildVastWrapper, getVastNode, getAdNode, getWrapperNode, getAdSystemNode,
|
|
2
|
+
getAdTagUriNode, getErrorNode, getImpressionNode } from 'libraries/video/shared/vastXmlBuilder.js';
|
|
3
|
+
import { expect } from 'chai';
|
|
4
|
+
|
|
5
|
+
describe('buildVastWrapper', function () {
|
|
6
|
+
it('should include impression and error nodes when requested', function () {
|
|
7
|
+
const vastXml = buildVastWrapper(
|
|
8
|
+
'adId123',
|
|
9
|
+
'http://wwww.testUrl.com/redirectUrl.xml',
|
|
10
|
+
'http://wwww.testUrl.com/impression.jpg',
|
|
11
|
+
'impressionId123',
|
|
12
|
+
'http://wwww.testUrl.com/error.jpg'
|
|
13
|
+
);
|
|
14
|
+
expect(vastXml).to.be.equal(`<VAST version="4.2"><Ad id="adId123"><Wrapper><AdSystem version="${$$PREBID_GLOBAL$$.version}">Prebid org</AdSystem><VASTAdTagURI><![CDATA[http://wwww.testUrl.com/redirectUrl.xml]]></VASTAdTagURI><Impression id="impressionId123"><![CDATA[http://wwww.testUrl.com/impression.jpg]]></Impression><Error><![CDATA[http://wwww.testUrl.com/error.jpg]]></Error></Wrapper></Ad></VAST>`);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should omit error nodes when excluded', function () {
|
|
18
|
+
const vastXml = buildVastWrapper(
|
|
19
|
+
'adId123',
|
|
20
|
+
'http://wwww.testUrl.com/redirectUrl.xml',
|
|
21
|
+
'http://wwww.testUrl.com/impression.jpg',
|
|
22
|
+
'impressionId123',
|
|
23
|
+
);
|
|
24
|
+
expect(vastXml).to.be.equal(`<VAST version="4.2"><Ad id="adId123"><Wrapper><AdSystem version="${$$PREBID_GLOBAL$$.version}">Prebid org</AdSystem><VASTAdTagURI><![CDATA[http://wwww.testUrl.com/redirectUrl.xml]]></VASTAdTagURI><Impression id="impressionId123"><![CDATA[http://wwww.testUrl.com/impression.jpg]]></Impression></Wrapper></Ad></VAST>`);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should omit impression nodes when excluded', function () {
|
|
28
|
+
const vastXml = buildVastWrapper(
|
|
29
|
+
'adId123',
|
|
30
|
+
'http://wwww.testUrl.com/redirectUrl.xml',
|
|
31
|
+
);
|
|
32
|
+
expect(vastXml).to.be.equal(`<VAST version="4.2"><Ad id="adId123"><Wrapper><AdSystem version="${$$PREBID_GLOBAL$$.version}">Prebid org</AdSystem><VASTAdTagURI><![CDATA[http://wwww.testUrl.com/redirectUrl.xml]]></VASTAdTagURI></Wrapper></Ad></VAST>`);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('getVastNode', function () {
|
|
37
|
+
it('should return well formed Vast node', function () {
|
|
38
|
+
const vastNode = getVastNode('body', '4.0');
|
|
39
|
+
expect(vastNode).to.be.equal('<VAST version=\"4.0\">body</VAST>');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should omit version when missing', function() {
|
|
43
|
+
const vastNode = getVastNode('body');
|
|
44
|
+
expect(vastNode).to.be.equal('<VAST>body</VAST>');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
describe('getAdNode', function () {
|
|
49
|
+
it('should return well formed Ad node', function () {
|
|
50
|
+
const adNode = getAdNode('body', 'adId123');
|
|
51
|
+
expect(adNode).to.be.equal('<Ad id=\"adId123\">body</Ad>');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should omit id when missing', function() {
|
|
55
|
+
const adNode = getAdNode('body');
|
|
56
|
+
expect(adNode).to.be.equal('<Ad>body</Ad>');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('getWrapperNode', function () {
|
|
61
|
+
it('should return well formed Wrapper node', function () {
|
|
62
|
+
const wrapperNode = getWrapperNode('body');
|
|
63
|
+
expect(wrapperNode).to.be.equal('<Wrapper>body</Wrapper>');
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
describe('getAdSystemNode', function () {
|
|
68
|
+
it('should return well formed AdSystem node', function () {
|
|
69
|
+
const adSystemNode = getAdSystemNode('testSysName', '5.0');
|
|
70
|
+
expect(adSystemNode).to.be.equal('<AdSystem version=\"5.0\">testSysName</AdSystem>');
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should omit version when missing', function() {
|
|
74
|
+
const adSystemNode = getAdSystemNode('testSysName');
|
|
75
|
+
expect(adSystemNode).to.be.equal('<AdSystem>testSysName</AdSystem>');
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe('getAdTagUriNode', function () {
|
|
80
|
+
it('should return well formed ad tag URI node', function () {
|
|
81
|
+
const adTagNode = getAdTagUriNode('http://wwww.testUrl.com/ad.xml');
|
|
82
|
+
expect(adTagNode).to.be.equal('<VASTAdTagURI><![CDATA[http://wwww.testUrl.com/ad.xml]]></VASTAdTagURI>');
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe('getImpressionNode', function () {
|
|
87
|
+
it('should return well formed Impression node', function () {
|
|
88
|
+
const impressionNode = getImpressionNode('http://wwww.testUrl.com/adImpression.jpg', 'impresionId123');
|
|
89
|
+
expect(impressionNode).to.be.equal('<Impression id=\"impresionId123\"><![CDATA[http://wwww.testUrl.com/adImpression.jpg]]></Impression>');
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should omit id when missing', function() {
|
|
93
|
+
const impressionNode = getImpressionNode('http://wwww.testUrl.com/adImpression.jpg');
|
|
94
|
+
expect(impressionNode).to.be.equal('<Impression><![CDATA[http://wwww.testUrl.com/adImpression.jpg]]></Impression>');
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
describe('getErrorNode', function () {
|
|
99
|
+
it('should return well formed Error node', function () {
|
|
100
|
+
const errorNode = getErrorNode('http://wwww.testUrl.com/adError.jpg');
|
|
101
|
+
expect(errorNode).to.be.equal('<Error><![CDATA[http://wwww.testUrl.com/adError.jpg]]></Error>');
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { vastXmlEditorFactory } from 'libraries/video/shared/vastXmlEditor.js';
|
|
2
|
+
import { expect } from 'chai';
|
|
3
|
+
|
|
4
|
+
describe('Vast XML Editor', function () {
|
|
5
|
+
const adWrapperXml = `
|
|
6
|
+
<VAST version="4.0">
|
|
7
|
+
<Ad id="123">
|
|
8
|
+
<Wrapper>
|
|
9
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
10
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
11
|
+
</Wrapper>
|
|
12
|
+
</Ad>
|
|
13
|
+
</VAST>
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const inlineXml = `
|
|
17
|
+
<VAST version="4.0">
|
|
18
|
+
<Ad id="abc">
|
|
19
|
+
<InLine>
|
|
20
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
21
|
+
<AdTitle>Random Title</AdTitle>
|
|
22
|
+
</InLine>
|
|
23
|
+
</Ad>
|
|
24
|
+
</VAST>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
const inLineWithWrapper = `
|
|
28
|
+
<VAST version="4.0">
|
|
29
|
+
<Ad id="123">
|
|
30
|
+
<Wrapper>
|
|
31
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
32
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
33
|
+
</Wrapper>
|
|
34
|
+
</Ad>
|
|
35
|
+
<Ad id="abc">
|
|
36
|
+
<InLine>
|
|
37
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
38
|
+
<AdTitle>Random Title</AdTitle>
|
|
39
|
+
</InLine>
|
|
40
|
+
</Ad>
|
|
41
|
+
</VAST>
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
const vastXmlEditor = vastXmlEditorFactory();
|
|
45
|
+
const expectedImpressionUrl = 'https://test.impression.com/ping.gif';
|
|
46
|
+
const expectedImpressionId = 'test-impression-id';
|
|
47
|
+
const expectedErrorUrl = 'https://test.error.com/ping.gif';
|
|
48
|
+
|
|
49
|
+
it('should add Impression Nodes to the Ad Wrapper', function () {
|
|
50
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(adWrapperXml, null, expectedImpressionUrl, expectedImpressionId);
|
|
51
|
+
const expectedXml = `<VAST version="4.0">
|
|
52
|
+
<Ad id="123">
|
|
53
|
+
<Wrapper>
|
|
54
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
55
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
56
|
+
<Impression id="${expectedImpressionId}"><![CDATA[${expectedImpressionUrl}]]></Impression></Wrapper>
|
|
57
|
+
</Ad>
|
|
58
|
+
</VAST>`;
|
|
59
|
+
expect(vastXml).to.equal(expectedXml);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should add Impression Nodes to the InLine', function () {
|
|
63
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(inlineXml, null, expectedImpressionUrl, expectedImpressionId);
|
|
64
|
+
const expectedXml = `<VAST version="4.0">
|
|
65
|
+
<Ad id="abc">
|
|
66
|
+
<InLine>
|
|
67
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
68
|
+
<AdTitle>Random Title</AdTitle>
|
|
69
|
+
<Impression id="${expectedImpressionId}"><![CDATA[${expectedImpressionUrl}]]></Impression></InLine>
|
|
70
|
+
</Ad>
|
|
71
|
+
</VAST>`;
|
|
72
|
+
expect(vastXml).to.equal(expectedXml);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('should add Impression Nodes to the Ad Wrapper and Inline', function () {
|
|
76
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(inLineWithWrapper, null, expectedImpressionUrl, expectedImpressionId);
|
|
77
|
+
const expectedXml = `<VAST version="4.0">
|
|
78
|
+
<Ad id="123">
|
|
79
|
+
<Wrapper>
|
|
80
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
81
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
82
|
+
<Impression id="${expectedImpressionId}"><![CDATA[${expectedImpressionUrl}]]></Impression></Wrapper>
|
|
83
|
+
</Ad>
|
|
84
|
+
<Ad id="abc">
|
|
85
|
+
<InLine>
|
|
86
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
87
|
+
<AdTitle>Random Title</AdTitle>
|
|
88
|
+
<Impression id="${expectedImpressionId}"><![CDATA[${expectedImpressionUrl}]]></Impression></InLine>
|
|
89
|
+
</Ad>
|
|
90
|
+
</VAST>`;
|
|
91
|
+
expect(vastXml).to.equal(expectedXml);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('should add Error Nodes to the Ad Wrapper', function () {
|
|
95
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(adWrapperXml, null, null, null, expectedErrorUrl);
|
|
96
|
+
const expectedXml = `<VAST version="4.0">
|
|
97
|
+
<Ad id="123">
|
|
98
|
+
<Wrapper>
|
|
99
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
100
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
101
|
+
<Error><![CDATA[${expectedErrorUrl}]]></Error></Wrapper>
|
|
102
|
+
</Ad>
|
|
103
|
+
</VAST>`;
|
|
104
|
+
expect(vastXml).to.equal(expectedXml);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should add Error Nodes to the InLine', function () {
|
|
108
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(inlineXml, null, null, null, expectedErrorUrl);
|
|
109
|
+
const expectedXml = `<VAST version="4.0">
|
|
110
|
+
<Ad id="abc">
|
|
111
|
+
<InLine>
|
|
112
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
113
|
+
<AdTitle>Random Title</AdTitle>
|
|
114
|
+
<Error><![CDATA[${expectedErrorUrl}]]></Error></InLine>
|
|
115
|
+
</Ad>
|
|
116
|
+
</VAST>`;
|
|
117
|
+
expect(vastXml).to.equal(expectedXml);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('should add Error Nodes to the Ad Wrapper and Inline', function () {
|
|
121
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(inLineWithWrapper, null, null, null, expectedErrorUrl);
|
|
122
|
+
const expectedXml = `<VAST version="4.0">
|
|
123
|
+
<Ad id="123">
|
|
124
|
+
<Wrapper>
|
|
125
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
126
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
127
|
+
<Error><![CDATA[${expectedErrorUrl}]]></Error></Wrapper>
|
|
128
|
+
</Ad>
|
|
129
|
+
<Ad id="abc">
|
|
130
|
+
<InLine>
|
|
131
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
132
|
+
<AdTitle>Random Title</AdTitle>
|
|
133
|
+
<Error><![CDATA[${expectedErrorUrl}]]></Error></InLine>
|
|
134
|
+
</Ad>
|
|
135
|
+
</VAST>`;
|
|
136
|
+
expect(vastXml).to.equal(expectedXml);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('should add Impression Nodes and Error Nodes to the Ad Wrapper', function () {
|
|
140
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(adWrapperXml, null, expectedImpressionUrl, expectedImpressionId, expectedErrorUrl);
|
|
141
|
+
const expectedXml = `<VAST version="4.0">
|
|
142
|
+
<Ad id="123">
|
|
143
|
+
<Wrapper>
|
|
144
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
145
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
146
|
+
<Impression id="${expectedImpressionId}"><![CDATA[${expectedImpressionUrl}]]></Impression><Error><![CDATA[${expectedErrorUrl}]]></Error></Wrapper>
|
|
147
|
+
</Ad>
|
|
148
|
+
</VAST>`;
|
|
149
|
+
expect(vastXml).to.equal(expectedXml);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('should add Impression Nodes and Error Nodes to the InLine', function () {
|
|
153
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(inlineXml, null, expectedImpressionUrl, expectedImpressionId, expectedErrorUrl);
|
|
154
|
+
const expectedXml = `<VAST version="4.0">
|
|
155
|
+
<Ad id="abc">
|
|
156
|
+
<InLine>
|
|
157
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
158
|
+
<AdTitle>Random Title</AdTitle>
|
|
159
|
+
<Impression id="${expectedImpressionId}"><![CDATA[${expectedImpressionUrl}]]></Impression><Error><![CDATA[${expectedErrorUrl}]]></Error></InLine>
|
|
160
|
+
</Ad>
|
|
161
|
+
</VAST>`;
|
|
162
|
+
expect(vastXml).to.equal(expectedXml);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('should add Impression Nodes and Error Nodes to the Ad Wrapper and Inline', function () {
|
|
166
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(inLineWithWrapper, null, expectedImpressionUrl, expectedImpressionId, expectedErrorUrl);
|
|
167
|
+
const expectedXml = `<VAST version="4.0">
|
|
168
|
+
<Ad id="123">
|
|
169
|
+
<Wrapper>
|
|
170
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
171
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
172
|
+
<Impression id="${expectedImpressionId}"><![CDATA[${expectedImpressionUrl}]]></Impression><Error><![CDATA[${expectedErrorUrl}]]></Error></Wrapper>
|
|
173
|
+
</Ad>
|
|
174
|
+
<Ad id="abc">
|
|
175
|
+
<InLine>
|
|
176
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
177
|
+
<AdTitle>Random Title</AdTitle>
|
|
178
|
+
<Impression id="${expectedImpressionId}"><![CDATA[${expectedImpressionUrl}]]></Impression><Error><![CDATA[${expectedErrorUrl}]]></Error></InLine>
|
|
179
|
+
</Ad>
|
|
180
|
+
</VAST>`;
|
|
181
|
+
expect(vastXml).to.equal(expectedXml);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('should override the ad id in inline', function () {
|
|
185
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(inlineXml, 'adIdOverride');
|
|
186
|
+
const expectedXml = `<VAST version="4.0">
|
|
187
|
+
<Ad id="adIdOverride">
|
|
188
|
+
<InLine>
|
|
189
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
190
|
+
<AdTitle>Random Title</AdTitle>
|
|
191
|
+
</InLine>
|
|
192
|
+
</Ad>
|
|
193
|
+
</VAST>`;
|
|
194
|
+
expect(vastXml).to.equal(expectedXml);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('should override the ad id in the Ad Wrapper', function () {
|
|
198
|
+
const vastXml = vastXmlEditor.getVastXmlWithTracking(adWrapperXml, 'adIdOverride');
|
|
199
|
+
const expectedXml = `<VAST version="4.0">
|
|
200
|
+
<Ad id="adIdOverride">
|
|
201
|
+
<Wrapper>
|
|
202
|
+
<AdSystem version="6">Prebid org</AdSystem>
|
|
203
|
+
<VASTAdTagURI><![CDATA[https://random.adTag.com]]></VASTAdTagURI>
|
|
204
|
+
</Wrapper>
|
|
205
|
+
</Ad>
|
|
206
|
+
</VAST>`;
|
|
207
|
+
expect(vastXml).to.equal(expectedXml);
|
|
208
|
+
});
|
|
209
|
+
});
|