prebid.js 7.18.0 → 7.20.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/33acrossIdSystem.js +1 -1
- package/dist/adWMGAnalyticsAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adfBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adlooxAdServerVideo.js +1 -1
- package/dist/adlooxAnalyticsAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adomikAnalyticsAdapter.js +1 -1
- package/dist/adqueryIdSystem.js +1 -1
- package/dist/adrelevantisBidAdapter.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/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.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/atsAnalyticsAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/{andBeyondMediaBidAdapter.js → beyondmediaBidAdapter.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/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/byDataAnalyticsAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/categoryTranslation.js +1 -1
- package/dist/cleanioRtdProvider.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/consentManagement.js +1 -1
- package/dist/consentManagementUsp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -0
- 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/datablocksAnalyticsAdapter.js +1 -1
- package/dist/dchain.js +1 -1
- package/dist/debugging-standalone.js +1 -1
- package/dist/debugging.js +1 -1
- package/dist/dependencies.json +9 -0
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dianomiBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/enrichmentFpdModule.js +1 -1
- package/dist/eplanningAnalyticsAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fintezaAnalyticsAdapter.js +1 -1
- package/dist/fpd.js +1 -0
- package/dist/ftrackIdSystem.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/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hadronAnalyticsAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/invisiblyAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/kinessoIdSystem.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentAnalyticsAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/livewrappedAnalyticsAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/lotamePanoramaIdSystem.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -0
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mass.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/multibid.js +1 -1
- package/dist/nativoBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +198 -194
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxAnalyticsAdapter.js +1 -1
- package/dist/optimonAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pianoDmpAnalyticsAdapter.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/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubperfAnalyticsAdapter.js +1 -1
- package/dist/pubstackAnalyticsAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pulsepointAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/quantcastIdSystem.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/realvuAnalyticsAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/relevantAnalyticsAdapter.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/rtdModule.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/s2sTesting.js +1 -1
- package/dist/scaleableAnalyticsAdapter.js +1 -1
- package/dist/schain.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharedIdSystem.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/sigmoidAnalyticsAdapter.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/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/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.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 -0
- package/dist/terceptAnalyticsAdapter.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/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/yandexBidAdapter.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/libraries/fpd/sua.js +98 -0
- package/modules/.submodules.json +1 -0
- package/modules/adfBidAdapter.js +1 -1
- package/modules/adkernelAdnBidAdapter.js +1 -0
- package/modules/adkernelBidAdapter.js +2 -2
- package/modules/adqueryIdSystem.js +8 -8
- package/modules/adxcgBidAdapter.js +1 -1
- package/modules/amxBidAdapter.js +1 -1
- package/modules/aolBidAdapter.js +25 -2
- package/modules/appnexusBidAdapter.js +19 -2
- package/modules/{andBeyondMediaBidAdapter.js → beyondmediaBidAdapter.js} +0 -0
- package/modules/{andBeyondMediaBidAdapter.md → beyondmediaBidAdapter.md} +1 -1
- package/modules/categoryTranslation.js +4 -4
- package/modules/cleanioRtdProvider.js +3 -4
- package/modules/colossussspBidAdapter.js +2 -1
- package/modules/connectIdSystem.js +16 -1
- package/modules/conversantAnalyticsAdapter.js +560 -0
- package/modules/conversantAnalyticsAdapter.md +47 -0
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/currency.js +11 -11
- package/modules/dchain.js +2 -2
- package/modules/debugging/bidInterceptor.js +2 -2
- package/modules/debugging/debugging.js +10 -2
- package/modules/debugging/legacy.js +2 -2
- package/modules/dgkeywordRtdProvider.js +21 -3
- package/modules/dianomiBidAdapter.js +1 -1
- package/modules/enrichmentFpdModule.js +33 -14
- package/modules/eplanningBidAdapter.js +48 -2
- package/modules/finativeBidAdapter.js +1 -1
- package/modules/gridBidAdapter.js +187 -117
- package/modules/improvedigitalBidAdapter.js +2 -2
- package/modules/ixBidAdapter.js +94 -23
- package/modules/liveIntentIdSystem.js +39 -5
- package/modules/lotamePanoramaIdSystem.js +10 -6
- package/modules/magniteAnalyticsAdapter.js +902 -0
- package/modules/magniteAnalyticsAdapter.md +18 -0
- package/modules/mass.js +2 -2
- package/modules/mediakeysBidAdapter.js +6 -1
- package/modules/mediakeysBidAdapter.md +50 -40
- package/modules/multibid/index.js +5 -5
- package/modules/nativoBidAdapter.js +1 -1
- package/modules/pixfutureBidAdapter.js +46 -15
- package/modules/prebidServerBidAdapter/index.js +54 -19
- package/modules/priceFloors.js +8 -22
- package/modules/readpeakBidAdapter.js +1 -1
- package/modules/rubiconAnalyticsAdapter.js +14 -9
- package/modules/rubiconBidAdapter.js +2 -3
- package/modules/seedingAllianceBidAdapter.js +1 -1
- package/modules/sharethroughBidAdapter.js +1 -1
- package/modules/taboolaBidAdapter.js +5 -5
- package/modules/talkadsBidAdapter.js +1 -0
- package/modules/teadsIdSystem.js +234 -0
- package/modules/teadsIdSystem.md +22 -0
- package/modules/truereachBidAdapter.js +1 -0
- package/modules/ttdBidAdapter.js +1 -1
- package/modules/userId/index.js +21 -14
- package/modules/vrtcalBidAdapter.js +7 -1
- package/modules/vuukleBidAdapter.js +34 -3
- package/modules/yahoosspBidAdapter.js +4 -2
- package/modules/yandexBidAdapter.js +31 -8
- package/package.json +2 -2
- package/src/adapterManager.js +2 -4
- package/src/adapters/bidderFactory.js +13 -11
- package/src/auction.js +140 -69
- package/src/constants.json +8 -0
- package/src/cpmBucketManager.js +22 -3
- package/src/native.js +1 -5
- package/src/prebid.js +5 -6
- package/src/targeting.js +31 -14
- package/test/fixtures/fixtures.js +2 -1
- package/test/spec/auctionmanager_spec.js +109 -21
- package/test/spec/cpmBucketManager_spec.js +239 -177
- package/test/spec/fpd/sua_spec.js +244 -0
- package/test/spec/modules/adfBidAdapter_spec.js +2 -3
- package/test/spec/modules/adqueryIdSystem_spec.js +0 -2
- package/test/spec/modules/adxcgBidAdapter_spec.js +2 -3
- package/test/spec/modules/amxBidAdapter_spec.js +3 -2
- package/test/spec/modules/aolBidAdapter_spec.js +42 -9
- package/test/spec/modules/appnexusBidAdapter_spec.js +24 -0
- package/test/spec/modules/{andBeyondMediaBidAdapter_spec.js → beyondmediaBidAdapter_spec.js} +1 -1
- package/test/spec/modules/colossussspBidAdapter_spec.js +4 -2
- package/test/spec/modules/connectIdSystem_spec.js +20 -0
- package/test/spec/modules/conversantAnalyticsAdapter_spec.js +963 -0
- package/test/spec/modules/currency_spec.js +14 -6
- package/test/spec/modules/debugging_mod_spec.js +9 -0
- package/test/spec/modules/dgkeywordRtdProvider_spec.js +83 -1
- package/test/spec/modules/dianomiBidAdapter_spec.js +2 -3
- package/test/spec/modules/enrichmentFpdModule_spec.js +50 -7
- package/test/spec/modules/eplanningBidAdapter_spec.js +285 -1
- package/test/spec/modules/fpdModule_spec.js +9 -0
- package/test/spec/modules/gridBidAdapter_spec.js +87 -31
- package/test/spec/modules/ixBidAdapter_spec.js +221 -2
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +62 -8
- package/test/spec/modules/liveIntentIdSystem_spec.js +62 -8
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +0 -1
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +1942 -0
- package/test/spec/modules/mediakeysBidAdapter_spec.js +20 -3
- package/test/spec/modules/nativoBidAdapter_spec.js +13 -2
- package/test/spec/modules/prebidServerBidAdapter_spec.js +202 -15
- package/test/spec/modules/priceFloors_spec.js +5 -5
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +2 -3
- package/test/spec/modules/seedtagBidAdapter_spec.js +15 -18
- package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
- package/test/spec/modules/taboolaBidAdapter_spec.js +112 -13
- package/test/spec/modules/teadsIdSystem_spec.js +271 -0
- package/test/spec/modules/ttdBidAdapter_spec.js +3 -3
- package/test/spec/modules/userId_spec.js +39 -4
- package/test/spec/modules/vrtcalBidAdapter_spec.js +12 -1
- package/test/spec/modules/vuukleBidAdapter_spec.js +87 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +48 -1
- package/test/spec/modules/yandexBidAdapter_spec.js +8 -5
- package/test/spec/native_spec.js +5 -0
- package/test/spec/unit/core/bidderFactory_spec.js +66 -11
- package/test/spec/unit/core/targeting_spec.js +28 -9
- package/test/spec/unit/pbjs_api_spec.js +48 -2
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import {
|
|
2
|
+
teadsIdSubmodule,
|
|
3
|
+
storage,
|
|
4
|
+
buildAnalyticsTagUrl,
|
|
5
|
+
getGdprStatus,
|
|
6
|
+
gdprStatus,
|
|
7
|
+
getPublisherId,
|
|
8
|
+
getGdprConsentString,
|
|
9
|
+
getCookieExpirationDate, getTimestampFromDays, getCcpaConsentString
|
|
10
|
+
} from 'modules/teadsIdSystem.js';
|
|
11
|
+
import {server} from 'test/mocks/xhr.js';
|
|
12
|
+
import * as utils from '../../../src/utils.js';
|
|
13
|
+
|
|
14
|
+
const FP_TEADS_ID_COOKIE_NAME = '_tfpvi';
|
|
15
|
+
const teadsCookieIdSent = 'teadsCookieIdSent';
|
|
16
|
+
const EXPIRED_COOKIE_DATE = 'Thu, 01 Jan 1970 00:00:01 GMT';
|
|
17
|
+
|
|
18
|
+
describe('TeadsIdSystem', function () {
|
|
19
|
+
describe('buildAnalyticsTagUrl', function () {
|
|
20
|
+
it('return complete URL of server request', function () {
|
|
21
|
+
const submoduleConfig = {
|
|
22
|
+
params: {
|
|
23
|
+
pubId: 1234
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const consentData = {
|
|
28
|
+
gdprApplies: true,
|
|
29
|
+
consentString: 'abc123=='
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const result = buildAnalyticsTagUrl(submoduleConfig, consentData);
|
|
33
|
+
const expected = 'https://at.teads.tv/fpc?analytics_tag_id=PUB_1234&tfpvi=&gdpr_consent=abc123%3D%3D&gdpr_status=12&gdpr_reason=120&ccpa_consent=&sv=prebid-v1'
|
|
34
|
+
expect(result).to.be.equal(expected);
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe('getPublisherId', function () {
|
|
39
|
+
it('return empty string if params.pubId param is missing', function () {
|
|
40
|
+
const submoduleConfig = {};
|
|
41
|
+
const result = getPublisherId(submoduleConfig);
|
|
42
|
+
const expected = '';
|
|
43
|
+
expect(result).to.be.equal(expected);
|
|
44
|
+
});
|
|
45
|
+
it('return empty string if params.pubId param has a wrong value', function () {
|
|
46
|
+
const pubIdDifferentValues = [null, undefined, false, true, {}, [], 'abc123'];
|
|
47
|
+
|
|
48
|
+
pubIdDifferentValues.forEach((value) => {
|
|
49
|
+
const submoduleConfig = {
|
|
50
|
+
params: {
|
|
51
|
+
pubId: value
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const result = getPublisherId(submoduleConfig);
|
|
55
|
+
const expected = '';
|
|
56
|
+
expect(result).to.be.equal(expected);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
it('return a publisherId prefixed by PUB_ string if params.pubId has a good value', function () {
|
|
60
|
+
const pubIdDifferentValues = [1234, '1234'];
|
|
61
|
+
|
|
62
|
+
pubIdDifferentValues.forEach((value) => {
|
|
63
|
+
const submoduleConfig = {
|
|
64
|
+
params: {
|
|
65
|
+
pubId: value
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const result = getPublisherId(submoduleConfig);
|
|
69
|
+
const expected = 'PUB_1234';
|
|
70
|
+
expect(result).to.be.equal(expected);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe('getGdprConsentString', function () {
|
|
76
|
+
it('return empty consentString if no consentData given', function () {
|
|
77
|
+
const consentDataDifferentValues = [{}, undefined, null];
|
|
78
|
+
|
|
79
|
+
consentDataDifferentValues.forEach((value) => {
|
|
80
|
+
const result = getGdprConsentString(value);
|
|
81
|
+
const expected = '';
|
|
82
|
+
expect(result).to.be.equal(expected);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
it('return empty consentString if consentString has a wrong format', function () {
|
|
86
|
+
const consentStringDifferentValues = [1, 0, undefined, null, {}];
|
|
87
|
+
|
|
88
|
+
consentStringDifferentValues.forEach((value) => {
|
|
89
|
+
const consentData = {
|
|
90
|
+
consentString: value
|
|
91
|
+
};
|
|
92
|
+
const result = getGdprConsentString(consentData);
|
|
93
|
+
const expected = '';
|
|
94
|
+
expect(result).to.be.equal(expected);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
it('return a good consentString if present and a correct format', function () {
|
|
98
|
+
const consentData = {
|
|
99
|
+
consentString: 'consent-string-teads-O1'
|
|
100
|
+
};
|
|
101
|
+
const result = getGdprConsentString(consentData);
|
|
102
|
+
const expected = 'consent-string-teads-O1';
|
|
103
|
+
expect(result).to.be.equal(expected);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
describe('getCcpaConsentString', function () {
|
|
108
|
+
it('return empty CCPA consentString if no CCPA data is available or a wrong format', function () {
|
|
109
|
+
const consentDataDifferentValues = [{}, undefined, null, 123];
|
|
110
|
+
|
|
111
|
+
consentDataDifferentValues.forEach((value) => {
|
|
112
|
+
const result = getCcpaConsentString(value);
|
|
113
|
+
const expected = '';
|
|
114
|
+
expect(result).to.be.equal(expected);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
it('return CCPA consentString if CCPA data is available and a good format', function () {
|
|
118
|
+
const consentData = '1NYN';
|
|
119
|
+
const result = getCcpaConsentString(consentData);
|
|
120
|
+
const expected = '1NYN';
|
|
121
|
+
expect(result).to.be.equal(expected);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
describe('getGdprStatus', function () {
|
|
126
|
+
it('return CMP_NOT_FOUND_OR_ERROR if no given consentData', function () {
|
|
127
|
+
const consentDataDifferentValues = [{}, undefined, null];
|
|
128
|
+
|
|
129
|
+
consentDataDifferentValues.forEach((value) => {
|
|
130
|
+
const result = getGdprStatus(value);
|
|
131
|
+
const expected = gdprStatus.CMP_NOT_FOUND_OR_ERROR;
|
|
132
|
+
expect(result).to.be.equal(expected);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
it('return CMP_NOT_FOUND_OR_ERROR if gdprApplies param has a wrong format', function () {
|
|
136
|
+
const gdprAppliesDifferentValues = ['yes', 'true', 1, 0, undefined, null, {}];
|
|
137
|
+
|
|
138
|
+
gdprAppliesDifferentValues.forEach((value) => {
|
|
139
|
+
const consentData = {
|
|
140
|
+
gdprApplies: value
|
|
141
|
+
};
|
|
142
|
+
const result = getGdprStatus(consentData);
|
|
143
|
+
const expected = gdprStatus.CMP_NOT_FOUND_OR_ERROR;
|
|
144
|
+
expect(result).to.be.equal(expected);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
it('return GDPR_DOESNT_APPLY if gdprApplies are false', function () {
|
|
148
|
+
const consentData = {
|
|
149
|
+
gdprApplies: false
|
|
150
|
+
};
|
|
151
|
+
const result = getGdprStatus(consentData);
|
|
152
|
+
const expected = gdprStatus.GDPR_DOESNT_APPLY;
|
|
153
|
+
expect(result).to.be.equal(expected);
|
|
154
|
+
});
|
|
155
|
+
it('return GDPR_APPLIES_PUBLISHER if gdprApplies are true', function () {
|
|
156
|
+
const consentData = {
|
|
157
|
+
gdprApplies: true
|
|
158
|
+
};
|
|
159
|
+
const result = getGdprStatus(consentData);
|
|
160
|
+
const expected = gdprStatus.GDPR_APPLIES_PUBLISHER;
|
|
161
|
+
expect(result).to.be.equal(expected);
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
describe('getExpirationDate', function () {
|
|
166
|
+
it('return Date Formatted if no given consentData', function () {
|
|
167
|
+
let timeStampStub;
|
|
168
|
+
timeStampStub = sinon.stub(utils, 'timestamp').returns(Date.UTC(2022, 8, 19, 14, 30, 50, 0));
|
|
169
|
+
const cookiesMaxAge = getTimestampFromDays(365);
|
|
170
|
+
|
|
171
|
+
const result = getCookieExpirationDate(cookiesMaxAge);
|
|
172
|
+
const expected = 'Tue, 19 Sep 2023 14:30:50 GMT';
|
|
173
|
+
expect(result).to.be.equal(expected);
|
|
174
|
+
timeStampStub.restore();
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
describe('getId', function () {
|
|
179
|
+
let setCookieStub, setLocalStorageStub, removeFromLocalStorageStub, logErrorStub, logInfoStub, timeStampStub;
|
|
180
|
+
const teadsUrl = 'https://at.teads.tv/fpc';
|
|
181
|
+
const timestampNow = new Date().getTime();
|
|
182
|
+
|
|
183
|
+
beforeEach(function () {
|
|
184
|
+
setCookieStub = sinon.stub(storage, 'setCookie');
|
|
185
|
+
timeStampStub = sinon.stub(utils, 'timestamp').returns(timestampNow);
|
|
186
|
+
logErrorStub = sinon.stub(utils, 'logError');
|
|
187
|
+
logInfoStub = sinon.stub(utils, 'logInfo');
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
afterEach(function () {
|
|
191
|
+
setCookieStub.restore();
|
|
192
|
+
timeStampStub.restore();
|
|
193
|
+
logErrorStub.restore();
|
|
194
|
+
logInfoStub.restore();
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('should log an error and continue to callback if request errors', function () {
|
|
198
|
+
const config = {
|
|
199
|
+
params: {}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const callbackSpy = sinon.spy();
|
|
203
|
+
const callback = teadsIdSubmodule.getId(config).callback;
|
|
204
|
+
callback(callbackSpy);
|
|
205
|
+
const request = server.requests[0];
|
|
206
|
+
expect(request.url).to.include(teadsUrl);
|
|
207
|
+
request.respond(503, null, 'Unavailable');
|
|
208
|
+
expect(logErrorStub.calledOnce).to.be.true;
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('should log an info and continue to callback if status 204 is sent', function () {
|
|
212
|
+
const config = {
|
|
213
|
+
params: {}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const callbackSpy = sinon.spy();
|
|
217
|
+
const callback = teadsIdSubmodule.getId(config).callback;
|
|
218
|
+
callback(callbackSpy);
|
|
219
|
+
const request = server.requests[0];
|
|
220
|
+
expect(request.url).to.include(teadsUrl);
|
|
221
|
+
request.respond(204, null, 'Unavailable');
|
|
222
|
+
expect(logInfoStub.calledOnce).to.be.true;
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('should call the callback with the response body if status 200 is sent', function () {
|
|
226
|
+
const config = {
|
|
227
|
+
params: {}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const callbackSpy = sinon.spy();
|
|
231
|
+
const callback = teadsIdSubmodule.getId(config).callback;
|
|
232
|
+
callback(callbackSpy);
|
|
233
|
+
const request = server.requests[0];
|
|
234
|
+
expect(request.url).to.include(teadsUrl);
|
|
235
|
+
request.respond(200, {'Content-Type': 'application/json'}, teadsCookieIdSent);
|
|
236
|
+
expect(callbackSpy.lastCall.lastArg).to.deep.equal(teadsCookieIdSent);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it('should save teadsId in cookie and local storage if it was returned by API', function () {
|
|
240
|
+
const config = {
|
|
241
|
+
params: {}
|
|
242
|
+
};
|
|
243
|
+
const result = teadsIdSubmodule.getId(config, {});
|
|
244
|
+
result.callback((id) => {
|
|
245
|
+
expect(id).to.be.deep.equal(teadsCookieIdSent);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
let request = server.requests[0];
|
|
249
|
+
request.respond(200, {'Content-Type': 'application/json'}, teadsCookieIdSent);
|
|
250
|
+
|
|
251
|
+
const cookiesMaxAge = getTimestampFromDays(365); // 1 year
|
|
252
|
+
const expirationCookieDate = getCookieExpirationDate(cookiesMaxAge);
|
|
253
|
+
expect(setCookieStub.calledWith(FP_TEADS_ID_COOKIE_NAME, teadsCookieIdSent, expirationCookieDate)).to.be.true;
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('should delete teadsId in cookie and local storage if it was not returned by API', function () {
|
|
257
|
+
const config = {
|
|
258
|
+
params: {}
|
|
259
|
+
};
|
|
260
|
+
const result = teadsIdSubmodule.getId(config, {});
|
|
261
|
+
result.callback((id) => {
|
|
262
|
+
expect(id).to.be.undefined
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
let request = server.requests[0];
|
|
266
|
+
request.respond(200, {'Content-Type': 'application/json'}, '');
|
|
267
|
+
|
|
268
|
+
expect(setCookieStub.calledWith(FP_TEADS_ID_COOKIE_NAME, '', EXPIRED_COOKIE_DATE)).to.be.true;
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
});
|
|
@@ -272,10 +272,10 @@ describe('ttdBidAdapter', function () {
|
|
|
272
272
|
expect(requestBody.imp[0].ext.gpid).to.equal(gpid);
|
|
273
273
|
});
|
|
274
274
|
|
|
275
|
-
it('sends
|
|
275
|
+
it('sends auction id in source.tid', function () {
|
|
276
276
|
const requestBody = testBuildRequests(baseBannerBidRequests, baseBidderRequest).data;
|
|
277
277
|
expect(requestBody.source).to.be.not.null;
|
|
278
|
-
expect(requestBody.source.tid).to.equal(
|
|
278
|
+
expect(requestBody.source.tid).to.equal(baseBidderRequest.auctionId);
|
|
279
279
|
});
|
|
280
280
|
|
|
281
281
|
it('includes the ad size in the bid request', function () {
|
|
@@ -557,7 +557,7 @@ describe('ttdBidAdapter', function () {
|
|
|
557
557
|
const requestBody = testBuildRequests(baseBannerMultipleBidRequests, baseBidderRequest).data;
|
|
558
558
|
expect(requestBody.imp.length).to.equal(2);
|
|
559
559
|
expect(requestBody.source).to.be.not.null;
|
|
560
|
-
expect(requestBody.source.tid).to.equal(
|
|
560
|
+
expect(requestBody.source.tid).to.equal(baseBidderRequest.auctionId);
|
|
561
561
|
expect(requestBody.imp[0].ext).to.be.not.null;
|
|
562
562
|
expect(requestBody.imp[0].ext.tid).to.equal('8651474f-58b1-4368-b812-84f8c937a099');
|
|
563
563
|
expect(requestBody.imp[1].ext).to.be.not.null;
|
|
@@ -405,6 +405,9 @@ describe('User ID', function () {
|
|
|
405
405
|
init(config);
|
|
406
406
|
setSubmoduleRegistry([amxIdSubmodule, sharedIdSystemSubmodule, identityLinkSubmodule, imuIdSubmodule]);
|
|
407
407
|
|
|
408
|
+
// before ppid should not be set
|
|
409
|
+
expect(window.googletag._ppid).to.equal(undefined);
|
|
410
|
+
|
|
408
411
|
config.setConfig({
|
|
409
412
|
userSync: {
|
|
410
413
|
ppid: 'pubcid.org',
|
|
@@ -416,19 +419,52 @@ describe('User ID', function () {
|
|
|
416
419
|
]
|
|
417
420
|
}
|
|
418
421
|
});
|
|
419
|
-
// before ppid should not be set
|
|
420
|
-
expect(window.googletag._ppid).to.equal(undefined);
|
|
421
422
|
return expectImmediateBidHook(() => {}, {adUnits}).then(() => {
|
|
422
423
|
// ppid should have been set without dashes and stuff
|
|
423
424
|
expect(window.googletag._ppid).to.equal('pubCommonidvaluepubCommonidvalue');
|
|
424
425
|
});
|
|
425
426
|
});
|
|
426
427
|
|
|
428
|
+
it('should set PPID when the source needs to call out to the network', () => {
|
|
429
|
+
let adUnits = [getAdUnitMock()];
|
|
430
|
+
init(config);
|
|
431
|
+
const callback = sinon.stub();
|
|
432
|
+
setSubmoduleRegistry([{
|
|
433
|
+
name: 'sharedId',
|
|
434
|
+
getId: function () {
|
|
435
|
+
return {callback}
|
|
436
|
+
},
|
|
437
|
+
decode(d) {
|
|
438
|
+
return d
|
|
439
|
+
}
|
|
440
|
+
}]);
|
|
441
|
+
config.setConfig({
|
|
442
|
+
userSync: {
|
|
443
|
+
ppid: 'pubcid.org',
|
|
444
|
+
auctionDelay: 10,
|
|
445
|
+
userIds: [
|
|
446
|
+
{
|
|
447
|
+
name: 'sharedId',
|
|
448
|
+
}
|
|
449
|
+
]
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
return expectImmediateBidHook(() => {}, {adUnits}).then(() => {
|
|
453
|
+
expect(window.googletag._ppid).to.be.undefined;
|
|
454
|
+
const uid = 'thismustbelongerthan32characters'
|
|
455
|
+
callback.yield({pubcid: uid});
|
|
456
|
+
expect(window.googletag._ppid).to.equal(uid);
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
|
|
427
460
|
it('should set googletag ppid correctly for imuIdSubmodule', function () {
|
|
428
461
|
let adUnits = [getAdUnitMock()];
|
|
429
462
|
init(config);
|
|
430
463
|
setSubmoduleRegistry([imuIdSubmodule]);
|
|
431
464
|
|
|
465
|
+
// before ppid should not be set
|
|
466
|
+
expect(window.googletag._ppid).to.equal(undefined);
|
|
467
|
+
|
|
432
468
|
config.setConfig({
|
|
433
469
|
userSync: {
|
|
434
470
|
ppid: 'ppid.intimatemerger.com',
|
|
@@ -437,8 +473,7 @@ describe('User ID', function () {
|
|
|
437
473
|
]
|
|
438
474
|
}
|
|
439
475
|
});
|
|
440
|
-
|
|
441
|
-
expect(window.googletag._ppid).to.equal(undefined);
|
|
476
|
+
|
|
442
477
|
return expectImmediateBidHook(() => {}, {adUnits}).then(() => {
|
|
443
478
|
// ppid should have been set without dashes and stuff
|
|
444
479
|
expect(window.googletag._ppid).to.equal('imppidvalueimppidvalueimppidvalue');
|
|
@@ -2,6 +2,7 @@ import { expect } from 'chai'
|
|
|
2
2
|
import { spec } from 'modules/vrtcalBidAdapter'
|
|
3
3
|
import { newBidder } from 'src/adapters/bidderFactory'
|
|
4
4
|
import { config } from 'src/config.js';
|
|
5
|
+
import { createEidsArray } from 'modules/userId/eids.js';
|
|
5
6
|
|
|
6
7
|
describe('vrtcalBidAdapter', function () {
|
|
7
8
|
const adapter = newBidder(spec)
|
|
@@ -27,6 +28,7 @@ describe('vrtcalBidAdapter', function () {
|
|
|
27
28
|
'bidId': 'bidID0001',
|
|
28
29
|
'bidderRequestId': 'br0001',
|
|
29
30
|
'auctionId': 'auction0001',
|
|
31
|
+
'userIdAsEids': {}
|
|
30
32
|
}
|
|
31
33
|
];
|
|
32
34
|
|
|
@@ -58,7 +60,7 @@ describe('vrtcalBidAdapter', function () {
|
|
|
58
60
|
config.setConfig({ coppa: false });
|
|
59
61
|
|
|
60
62
|
request = spec.buildRequests(bidRequests);
|
|
61
|
-
expect(request[0].data).to.match(/"user":{"ext":{"consent":"gdpr-consent-string"
|
|
63
|
+
expect(request[0].data).to.match(/"user":{"ext":{"consent":"gdpr-consent-string"/);
|
|
62
64
|
expect(request[0].data).to.match(/"regs":{"coppa":0,"ext":{"gdpr":1,"us_privacy":"ccpa-consent-string"}}/);
|
|
63
65
|
});
|
|
64
66
|
|
|
@@ -67,6 +69,15 @@ describe('vrtcalBidAdapter', function () {
|
|
|
67
69
|
request = spec.buildRequests(bidRequests);
|
|
68
70
|
expect(request[0].data).to.match(/"tmax":435/);
|
|
69
71
|
});
|
|
72
|
+
|
|
73
|
+
it('pass 3rd party IDs with the request when present', function () {
|
|
74
|
+
bidRequests[0].userIdAsEids = createEidsArray({
|
|
75
|
+
tdid: 'TTD_ID_FROM_USER_ID_MODULE'
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
request = spec.buildRequests(bidRequests);
|
|
79
|
+
expect(request[0].data).to.include(JSON.stringify({ext: {consent: 'gdpr-consent-string', eids: [{source: 'adserver.org', uids: [{id: 'TTD_ID_FROM_USER_ID_MODULE', atype: 1, ext: {rtiPartner: 'TDID'}}]}]}}));
|
|
80
|
+
});
|
|
70
81
|
});
|
|
71
82
|
|
|
72
83
|
describe('interpretResponse', function () {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { spec } from 'modules/vuukleBidAdapter.js';
|
|
3
|
+
import { config } from '../../../src/config.js';
|
|
3
4
|
|
|
4
5
|
describe('vuukleBidAdapterTests', function() {
|
|
5
6
|
let bidRequestData = {
|
|
@@ -34,6 +35,13 @@ describe('vuukleBidAdapterTests', function() {
|
|
|
34
35
|
expect(req_data.bidId).to.equal('testbid');
|
|
35
36
|
});
|
|
36
37
|
|
|
38
|
+
it('validate_generated_params_tmax', function() {
|
|
39
|
+
request = spec.buildRequests(bidRequestData.bids, {timeout: 1234});
|
|
40
|
+
let req_data = request[0].data;
|
|
41
|
+
|
|
42
|
+
expect(req_data.tmax).to.equal(1234);
|
|
43
|
+
});
|
|
44
|
+
|
|
37
45
|
it('validate_response_params', function() {
|
|
38
46
|
let serverResponse = {
|
|
39
47
|
body: {
|
|
@@ -58,4 +66,83 @@ describe('vuukleBidAdapterTests', function() {
|
|
|
58
66
|
expect(bid.creativeId).to.equal('12345');
|
|
59
67
|
expect(bid.meta.advertiserDomains).to.deep.equal(['example.com']);
|
|
60
68
|
});
|
|
69
|
+
|
|
70
|
+
describe('consent handling', function() {
|
|
71
|
+
const bidderRequest = {
|
|
72
|
+
gdprConsent: {
|
|
73
|
+
consentString: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
|
|
74
|
+
gdprApplies: 1,
|
|
75
|
+
vendorData: {
|
|
76
|
+
vendor: {
|
|
77
|
+
consents: {
|
|
78
|
+
1004: 1
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
it('must handle consent 1/1', function() {
|
|
86
|
+
request = spec.buildRequests(bidRequestData.bids, bidderRequest);
|
|
87
|
+
let req_data = request[0].data;
|
|
88
|
+
|
|
89
|
+
expect(req_data.gdpr).to.equal(1);
|
|
90
|
+
expect(req_data.consentGiven).to.equal(1);
|
|
91
|
+
expect(req_data.consent).to.equal('COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw');
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
it('must handle consent 0/1', function() {
|
|
95
|
+
bidderRequest.gdprConsent.gdprApplies = 0;
|
|
96
|
+
request = spec.buildRequests(bidRequestData.bids, bidderRequest);
|
|
97
|
+
let req_data = request[0].data;
|
|
98
|
+
|
|
99
|
+
expect(req_data.gdpr).to.equal(0);
|
|
100
|
+
expect(req_data.consentGiven).to.equal(1);
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it('must handle consent 0/0', function() {
|
|
104
|
+
bidderRequest.gdprConsent.gdprApplies = 0;
|
|
105
|
+
bidderRequest.gdprConsent.vendorData = undefined;
|
|
106
|
+
request = spec.buildRequests(bidRequestData.bids, bidderRequest);
|
|
107
|
+
let req_data = request[0].data;
|
|
108
|
+
|
|
109
|
+
expect(req_data.gdpr).to.equal(0);
|
|
110
|
+
expect(req_data.consentGiven).to.equal(0);
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('must handle consent undef', function() {
|
|
114
|
+
request = spec.buildRequests(bidRequestData.bids, {});
|
|
115
|
+
let req_data = request[0].data;
|
|
116
|
+
|
|
117
|
+
expect(req_data.gdpr).to.equal(0);
|
|
118
|
+
expect(req_data.consentGiven).to.equal(0);
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it('must handle usp consent', function() {
|
|
123
|
+
request = spec.buildRequests(bidRequestData.bids, {uspConsent: '1YNN'});
|
|
124
|
+
let req_data = request[0].data;
|
|
125
|
+
|
|
126
|
+
expect(req_data.uspConsent).to.equal('1YNN');
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
it('must handle undefined usp consent', function() {
|
|
130
|
+
request = spec.buildRequests(bidRequestData.bids, {});
|
|
131
|
+
let req_data = request[0].data;
|
|
132
|
+
|
|
133
|
+
expect(req_data.uspConsent).to.equal(undefined);
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
it('must handle coppa flag', function() {
|
|
137
|
+
sinon.stub(config, 'getConfig')
|
|
138
|
+
.withArgs('coppa')
|
|
139
|
+
.returns(true);
|
|
140
|
+
|
|
141
|
+
request = spec.buildRequests(bidRequestData.bids);
|
|
142
|
+
let req_data = request[0].data;
|
|
143
|
+
|
|
144
|
+
expect(req_data.coppa).to.equal(1);
|
|
145
|
+
|
|
146
|
+
config.getConfig.restore();
|
|
147
|
+
})
|
|
61
148
|
});
|
|
@@ -2,6 +2,7 @@ import { expect } from 'chai';
|
|
|
2
2
|
import { config } from 'src/config.js';
|
|
3
3
|
import { BANNER, VIDEO } from 'src/mediaTypes.js';
|
|
4
4
|
import { spec } from 'modules/yahoosspBidAdapter.js';
|
|
5
|
+
import {createEidsArray} from '../../../modules/userId/eids';
|
|
5
6
|
|
|
6
7
|
const DEFAULT_BID_ID = '84ab500420319d';
|
|
7
8
|
const DEFAULT_BID_DCN = '2093845709823475';
|
|
@@ -835,6 +836,50 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
835
836
|
});
|
|
836
837
|
});
|
|
837
838
|
|
|
839
|
+
describe('User data', () => {
|
|
840
|
+
it('should set the allowed sources user eids', () => {
|
|
841
|
+
const { validBidRequests, bidderRequest } = generateBuildRequestMock({});
|
|
842
|
+
validBidRequests[0].userIdAsEids = createEidsArray({
|
|
843
|
+
admixerId: 'admixerId_FROM_USER_ID_MODULE',
|
|
844
|
+
adtelligentId: 'adtelligentId_FROM_USER_ID_MODULE',
|
|
845
|
+
amxId: 'amxId_FROM_USER_ID_MODULE',
|
|
846
|
+
britepoolid: 'britepoolid_FROM_USER_ID_MODULE',
|
|
847
|
+
deepintentId: 'deepintentId_FROM_USER_ID_MODULE',
|
|
848
|
+
publinkId: 'publinkId_FROM_USER_ID_MODULE',
|
|
849
|
+
intentIqId: 'intentIqId_FROM_USER_ID_MODULE',
|
|
850
|
+
idl_env: 'idl_env_FROM_USER_ID_MODULE',
|
|
851
|
+
imuid: 'imuid_FROM_USER_ID_MODULE',
|
|
852
|
+
criteoId: 'criteoId_FROM_USER_ID_MODULE',
|
|
853
|
+
fabrickId: 'fabrickId_FROM_USER_ID_MODULE',
|
|
854
|
+
});
|
|
855
|
+
const data = spec.buildRequests(validBidRequests, bidderRequest).data;
|
|
856
|
+
|
|
857
|
+
expect(data.user.ext.eids).to.deep.equal([
|
|
858
|
+
{source: 'admixer.net', uids: [{id: 'admixerId_FROM_USER_ID_MODULE', atype: 3}]},
|
|
859
|
+
{source: 'adtelligent.com', uids: [{id: 'adtelligentId_FROM_USER_ID_MODULE', atype: 3}]},
|
|
860
|
+
{source: 'amxrtb.com', uids: [{id: 'amxId_FROM_USER_ID_MODULE', atype: 1}]},
|
|
861
|
+
{source: 'britepool.com', uids: [{id: 'britepoolid_FROM_USER_ID_MODULE', atype: 3}]},
|
|
862
|
+
{source: 'deepintent.com', uids: [{id: 'deepintentId_FROM_USER_ID_MODULE', atype: 3}]},
|
|
863
|
+
{source: 'epsilon.com', uids: [{id: 'publinkId_FROM_USER_ID_MODULE', atype: 3}]},
|
|
864
|
+
{source: 'intentiq.com', uids: [{id: 'intentIqId_FROM_USER_ID_MODULE', atype: 1}]},
|
|
865
|
+
{source: 'liveramp.com', uids: [{id: 'idl_env_FROM_USER_ID_MODULE', atype: 3}]},
|
|
866
|
+
{source: 'intimatemerger.com', uids: [{id: 'imuid_FROM_USER_ID_MODULE', atype: 1}]},
|
|
867
|
+
{source: 'criteo.com', uids: [{id: 'criteoId_FROM_USER_ID_MODULE', atype: 1}]},
|
|
868
|
+
{source: 'neustar.biz', uids: [{id: 'fabrickId_FROM_USER_ID_MODULE', atype: 1}]}
|
|
869
|
+
]);
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
it('should not set not allowed user eids sources', () => {
|
|
873
|
+
const { validBidRequests, bidderRequest } = generateBuildRequestMock({});
|
|
874
|
+
validBidRequests[0].userIdAsEids = createEidsArray({
|
|
875
|
+
justId: 'justId_FROM_USER_ID_MODULE'
|
|
876
|
+
});
|
|
877
|
+
const data = spec.buildRequests(validBidRequests, bidderRequest).data;
|
|
878
|
+
|
|
879
|
+
expect(data.user.ext.eids).to.deep.equal([]);
|
|
880
|
+
});
|
|
881
|
+
});
|
|
882
|
+
|
|
838
883
|
describe('Request Payload oRTB bid validation:', () => {
|
|
839
884
|
it('should generate a valid openRTB bid-request object in the data field', () => {
|
|
840
885
|
const { validBidRequests, bidderRequest } = generateBuildRequestMock({});
|
|
@@ -847,7 +892,9 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
847
892
|
expect(data.device).to.deep.equal({
|
|
848
893
|
dnt: 0,
|
|
849
894
|
ua: navigator.userAgent,
|
|
850
|
-
ip: undefined
|
|
895
|
+
ip: undefined,
|
|
896
|
+
w: window.screen.width,
|
|
897
|
+
h: window.screen.height
|
|
851
898
|
});
|
|
852
899
|
|
|
853
900
|
expect(data.regs).to.deep.equal({
|
|
@@ -64,7 +64,9 @@ describe('Yandex adapter', function () {
|
|
|
64
64
|
|
|
65
65
|
const bidderRequest = {
|
|
66
66
|
refererInfo: {
|
|
67
|
-
domain: '
|
|
67
|
+
domain: 'ya.ru',
|
|
68
|
+
ref: 'https://ya.ru/',
|
|
69
|
+
page: 'https://ya.ru/',
|
|
68
70
|
},
|
|
69
71
|
gdprConsent
|
|
70
72
|
};
|
|
@@ -72,7 +74,7 @@ describe('Yandex adapter', function () {
|
|
|
72
74
|
it('creates a valid banner request', function () {
|
|
73
75
|
const bannerRequest = getBidRequest();
|
|
74
76
|
bannerRequest.getFloor = () => ({
|
|
75
|
-
currency: '
|
|
77
|
+
currency: 'EUR',
|
|
76
78
|
// floor: 0.5
|
|
77
79
|
});
|
|
78
80
|
|
|
@@ -89,11 +91,11 @@ describe('Yandex adapter', function () {
|
|
|
89
91
|
const parsedRequestUrl = parseUrl(url);
|
|
90
92
|
const { search: query } = parsedRequestUrl
|
|
91
93
|
|
|
92
|
-
expect(parsedRequestUrl.hostname).to.equal('bs
|
|
94
|
+
expect(parsedRequestUrl.hostname).to.equal('bs.yandex.ru');
|
|
93
95
|
expect(parsedRequestUrl.pathname).to.equal('/metadsp/123');
|
|
94
96
|
|
|
95
97
|
expect(query['imp-id']).to.equal('1');
|
|
96
|
-
expect(query['target-ref']).to.equal('
|
|
98
|
+
expect(query['target-ref']).to.equal('ya.ru');
|
|
97
99
|
expect(query['ssp-id']).to.equal('10500');
|
|
98
100
|
|
|
99
101
|
expect(query['gdpr']).to.equal('1');
|
|
@@ -101,7 +103,8 @@ describe('Yandex adapter', function () {
|
|
|
101
103
|
|
|
102
104
|
expect(request.data).to.exist;
|
|
103
105
|
expect(data.site).to.not.equal(null);
|
|
104
|
-
expect(data.site.
|
|
106
|
+
expect(data.site.page_url).to.equal('https://ya.ru/');
|
|
107
|
+
expect(data.site.ref_url).to.equal('https://ya.ru/');
|
|
105
108
|
|
|
106
109
|
// expect(data.device).to.not.equal(null);
|
|
107
110
|
// expect(data.device.w).to.equal(window.innerWidth);
|
package/test/spec/native_spec.js
CHANGED
|
@@ -190,6 +190,11 @@ describe('native.js', function () {
|
|
|
190
190
|
expect(targeting.hb_native_foo).to.equal(bid.native.foo);
|
|
191
191
|
});
|
|
192
192
|
|
|
193
|
+
it('can get targeting from null native keys', () => {
|
|
194
|
+
const targeting = getNativeTargeting({...bid, native: {...bid.native, displayUrl: null}});
|
|
195
|
+
expect(targeting.hb_native_displayurl).to.not.be.ok;
|
|
196
|
+
})
|
|
197
|
+
|
|
193
198
|
it('sends placeholders for configured assets', function () {
|
|
194
199
|
const adUnit = {
|
|
195
200
|
transactionId: 'au',
|