prebid.js 6.2.0 → 6.6.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/.circleci/config.yml +1 -1
- package/gulpfile.js +87 -82
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/karma.conf.maker.js +1 -1
- package/modules/.submodules.json +2 -1
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/adkernelBidAdapter.js +148 -62
- package/modules/adlooxAdServerVideo.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +4 -4
- package/modules/admanBidAdapter.js +11 -4
- package/modules/admixerBidAdapter.js +1 -1
- package/modules/adnuntiusBidAdapter.js +3 -1
- package/modules/adomikAnalyticsAdapter.js +27 -9
- package/modules/adqueryIdSystem.js +103 -0
- package/modules/adqueryIdSystem.md +35 -0
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/adxcgBidAdapter.md +22 -21
- package/modules/adyoulikeBidAdapter.js +13 -9
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +0 -1
- package/modules/beopBidAdapter.js +6 -4
- package/modules/bidViewability.js +3 -3
- package/modules/bidViewabilityIO.js +3 -3
- package/modules/bliinkBidAdapter.js +3 -2
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/compassBidAdapter.js +208 -0
- package/modules/compassBidAdapter.md +79 -0
- package/modules/consentManagement.js +7 -1
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/criteoIdSystem.js +29 -7
- package/modules/currency.js +2 -2
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/dailyhuntBidAdapter.js +435 -0
- package/modules/dailyhuntBidAdapter.md +4 -0
- package/modules/docereeBidAdapter.js +10 -1
- package/modules/docereeBidAdapter.md +2 -0
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/engageyaBidAdapter.js +1 -1
- package/modules/feedadBidAdapter.js +2 -2
- package/modules/feedadBidAdapter.md +4 -2
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +82 -47
- package/modules/gptPreAuction.js +55 -7
- package/modules/gridBidAdapter.js +4 -3
- package/modules/gumgumBidAdapter.js +2 -2
- package/modules/idImportLibrary.js +45 -8
- package/modules/idImportLibrary.md +4 -0
- package/modules/improvedigitalBidAdapter.js +42 -4
- package/modules/instreamTracking.js +4 -4
- package/modules/invibesBidAdapter.js +49 -5
- package/modules/invibesBidAdapter.md +2 -1
- package/modules/ixBidAdapter.js +53 -18
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +3 -1
- package/modules/livewrappedBidAdapter.js +8 -2
- package/modules/loglyliftBidAdapter.js +79 -0
- package/modules/loglyliftBidAdapter.md +55 -0
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/nextMillenniumBidAdapter.js +39 -7
- package/modules/oguryBidAdapter.js +9 -2
- package/modules/onetagBidAdapter.js +4 -2
- package/modules/optimeraRtdProvider.js +8 -1
- package/modules/ozoneBidAdapter.js +21 -64
- package/modules/prebidServerBidAdapter/index.js +16 -12
- package/modules/proxistoreBidAdapter.js +0 -2
- package/modules/pubgeniusBidAdapter.js +1 -1
- package/modules/pubmaticAnalyticsAdapter.js +16 -0
- package/modules/pubxaiAnalyticsAdapter.js +17 -0
- package/modules/richaudienceBidAdapter.js +4 -4
- package/modules/riseBidAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +14 -4
- package/modules/rtdModule/index.js +49 -18
- package/modules/rubiconBidAdapter.js +31 -19
- package/modules/sharedIdSystem.js +27 -1
- package/modules/showheroes-bsBidAdapter.js +13 -2
- package/modules/tappxBidAdapter.js +8 -5
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/teadsBidAdapter.js +1 -2
- package/modules/telariaBidAdapter.js +2 -2
- package/modules/trustxBidAdapter.js +8 -16
- package/modules/userId/eids.js +7 -1
- package/modules/userId/userId.md +8 -0
- package/modules/vidoomyBidAdapter.js +16 -10
- package/modules/weboramaRtdProvider.js +288 -73
- package/modules/weboramaRtdProvider.md +27 -10
- package/modules/welectBidAdapter.js +106 -0
- package/modules/yahoosspBidAdapter.js +5 -1
- package/modules/yieldmoBidAdapter.js +23 -5
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspAnalyticsAdapter.js +97 -0
- package/modules/zeta_global_sspAnalyticsAdapter.md +24 -0
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +1 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/auction.js +2 -2
- package/src/config.js +27 -3
- package/src/hook.js +5 -1
- package/src/prebid.js +21 -6
- package/src/targeting.js +22 -1
- package/src/utils.js +46 -8
- package/test/helpers/prebidGlobal.js +1 -0
- package/test/spec/config_spec.js +279 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
- package/test/spec/modules/admanBidAdapter_spec.js +2 -2
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +17 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
- package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +49 -0
- package/test/spec/modules/beopBidAdapter_spec.js +1 -1
- package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
- package/test/spec/modules/bidViewability_spec.js +4 -4
- package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/compassBidAdapter_spec.js +398 -0
- package/test/spec/modules/consentManagement_spec.js +20 -0
- package/test/spec/modules/criteoIdSystem_spec.js +6 -3
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
- package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
- package/test/spec/modules/gptPreAuction_spec.js +177 -2
- package/test/spec/modules/idImportLibrary_spec.js +197 -10
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +45 -1
- package/test/spec/modules/invibesBidAdapter_spec.js +119 -0
- package/test/spec/modules/ixBidAdapter_spec.js +112 -62
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +75 -17
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +22 -0
- package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
- package/test/spec/modules/loglyliftBidAdapter_spec.js +172 -0
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +10 -2
- package/test/spec/modules/optimeraRtdProvider_spec.js +14 -1
- package/test/spec/modules/ozoneBidAdapter_spec.js +43 -31
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -0
- package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
- package/test/spec/modules/realTimeDataModule_spec.js +147 -48
- package/test/spec/modules/richaudienceBidAdapter_spec.js +42 -2
- package/test/spec/modules/riseBidAdapter_spec.js +1 -1
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
- package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
- package/test/spec/modules/userId_spec.js +68 -19
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/welectBidAdapter_spec.js +211 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/targeting_spec.js +72 -0
- package/test/spec/unit/pbjs_api_spec.js +3 -1
- package/test/spec/utils_spec.js +38 -0
- package/test/test_deps.js +3 -0
- package/test/test_index.js +1 -3
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { spec } from '../../../modules/loglyliftBidAdapter';
|
|
3
|
+
import * as utils from 'src/utils.js';
|
|
4
|
+
|
|
5
|
+
describe('loglyliftBidAdapter', function () {
|
|
6
|
+
const nativeBidRequests = [{
|
|
7
|
+
bidder: 'loglylift',
|
|
8
|
+
bidId: '254304ac29e265',
|
|
9
|
+
params: {
|
|
10
|
+
adspotId: 16
|
|
11
|
+
},
|
|
12
|
+
adUnitCode: '/19968336/prebid_native_example_1',
|
|
13
|
+
transactionId: '10aee457-617c-4572-ab5b-99df1d73ccb4',
|
|
14
|
+
sizes: [
|
|
15
|
+
[]
|
|
16
|
+
],
|
|
17
|
+
bidderRequestId: '15da3afd9632d7',
|
|
18
|
+
auctionId: 'f890b7d9-e787-4237-ac21-6d8554abac9f',
|
|
19
|
+
mediaTypes: {
|
|
20
|
+
native: {
|
|
21
|
+
body: {
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
title: {
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
image: {
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
sponsoredBy: {
|
|
34
|
+
required: true
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}];
|
|
39
|
+
|
|
40
|
+
const bidderRequest = {
|
|
41
|
+
refererInfo: {
|
|
42
|
+
referer: 'fakeReferer',
|
|
43
|
+
reachedTop: true,
|
|
44
|
+
numIframes: 1,
|
|
45
|
+
stack: []
|
|
46
|
+
},
|
|
47
|
+
auctionStart: 1632194172781,
|
|
48
|
+
bidderCode: 'loglylift',
|
|
49
|
+
bidderRequestId: '15da3afd9632d7',
|
|
50
|
+
auctionId: 'f890b7d9-e787-4237-ac21-6d8554abac9f',
|
|
51
|
+
timeout: 3000
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const nativeServerResponse = {
|
|
55
|
+
body: {
|
|
56
|
+
bids: [{
|
|
57
|
+
requestId: '254304ac29e265',
|
|
58
|
+
cpm: 10.123,
|
|
59
|
+
width: 360,
|
|
60
|
+
height: 360,
|
|
61
|
+
creativeId: '123456789',
|
|
62
|
+
currency: 'JPY',
|
|
63
|
+
netRevenue: true,
|
|
64
|
+
ttl: 30,
|
|
65
|
+
meta: {
|
|
66
|
+
advertiserDomains: ['advertiserexample.com']
|
|
67
|
+
},
|
|
68
|
+
native: {
|
|
69
|
+
clickUrl: 'https://dsp.logly.co.jp/click?ad=EXAMPECLICKURL',
|
|
70
|
+
image: {
|
|
71
|
+
url: 'https://cdn.logly.co.jp/images/000/194/300/normal.jpg',
|
|
72
|
+
width: '360',
|
|
73
|
+
height: '360'
|
|
74
|
+
},
|
|
75
|
+
impressionTrackers: [
|
|
76
|
+
'https://b.logly.co.jp/sorry.html'
|
|
77
|
+
],
|
|
78
|
+
sponsoredBy: 'logly',
|
|
79
|
+
title: 'Native Title',
|
|
80
|
+
}
|
|
81
|
+
}],
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
describe('isBidRequestValid', function () {
|
|
86
|
+
it('should return true if the adspotId parameter is present', function () {
|
|
87
|
+
expect(spec.isBidRequestValid(nativeBidRequests[0])).to.be.true;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('should return false if the adspotId parameter is not present', function () {
|
|
91
|
+
let bidRequest = utils.deepClone(nativeBidRequests[0]);
|
|
92
|
+
delete bidRequest.params.adspotId;
|
|
93
|
+
expect(spec.isBidRequestValid(bidRequest)).to.be.false;
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
describe('buildRequests', function () {
|
|
98
|
+
it('should generate a valid single POST request for multiple bid requests', function () {
|
|
99
|
+
const request = spec.buildRequests(nativeBidRequests, bidderRequest)[0];
|
|
100
|
+
expect(request.method).to.equal('POST');
|
|
101
|
+
expect(request.url).to.equal('https://bid.logly.co.jp/prebid/client/v1?adspot_id=16');
|
|
102
|
+
expect(request.data).to.exist;
|
|
103
|
+
|
|
104
|
+
const data = JSON.parse(request.data);
|
|
105
|
+
expect(data.auctionId).to.equal(nativeBidRequests[0].auctionId);
|
|
106
|
+
expect(data.bidderRequestId).to.equal(nativeBidRequests[0].bidderRequestId);
|
|
107
|
+
expect(data.transactionId).to.equal(nativeBidRequests[0].transactionId);
|
|
108
|
+
expect(data.adUnitCode).to.equal(nativeBidRequests[0].adUnitCode);
|
|
109
|
+
expect(data.bidId).to.equal(nativeBidRequests[0].bidId);
|
|
110
|
+
expect(data.mediaTypes).to.deep.equal(nativeBidRequests[0].mediaTypes);
|
|
111
|
+
expect(data.params).to.deep.equal(nativeBidRequests[0].params);
|
|
112
|
+
expect(data.prebidJsVersion).to.equal('$prebid.version$');
|
|
113
|
+
expect(data.url).to.exist;
|
|
114
|
+
expect(data.domain).to.exist;
|
|
115
|
+
expect(data.referer).to.equal(bidderRequest.refererInfo.referer);
|
|
116
|
+
expect(data.auctionStartTime).to.equal(bidderRequest.auctionStart);
|
|
117
|
+
expect(data.currency).to.exist;
|
|
118
|
+
expect(data.timeout).to.equal(bidderRequest.timeout);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
describe('interpretResponse', function () {
|
|
123
|
+
it('should return an empty array if an invalid response is passed', function () {
|
|
124
|
+
const interpretedResponse = spec.interpretResponse({}, {});
|
|
125
|
+
expect(interpretedResponse).to.be.an('array').that.is.empty;
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should return valid response when passed valid server response', function () {
|
|
129
|
+
const request = spec.buildRequests(nativeBidRequests, bidderRequest)[0];
|
|
130
|
+
const interpretedResponse = spec.interpretResponse(nativeServerResponse, request);
|
|
131
|
+
|
|
132
|
+
expect(interpretedResponse).to.have.lengthOf(1);
|
|
133
|
+
expect(interpretedResponse[0].cpm).to.equal(nativeServerResponse.body.bids[0].cpm);
|
|
134
|
+
expect(interpretedResponse[0].width).to.equal(nativeServerResponse.body.bids[0].width);
|
|
135
|
+
expect(interpretedResponse[0].height).to.equal(nativeServerResponse.body.bids[0].height);
|
|
136
|
+
expect(interpretedResponse[0].creativeId).to.equal(nativeServerResponse.body.bids[0].creativeId);
|
|
137
|
+
expect(interpretedResponse[0].currency).to.equal(nativeServerResponse.body.bids[0].currency);
|
|
138
|
+
expect(interpretedResponse[0].netRevenue).to.equal(nativeServerResponse.body.bids[0].netRevenue);
|
|
139
|
+
expect(interpretedResponse[0].ttl).to.equal(nativeServerResponse.body.bids[0].ttl);
|
|
140
|
+
expect(interpretedResponse[0].native).to.deep.equal(nativeServerResponse.body.bids[0].native);
|
|
141
|
+
expect(interpretedResponse[0].meta.advertiserDomains[0]).to.equal(nativeServerResponse.body.bids[0].meta.advertiserDomains[0]);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
describe('getUserSync tests', function () {
|
|
146
|
+
it('UserSync test : check type = iframe, check usermatch URL', function () {
|
|
147
|
+
const syncOptions = {
|
|
148
|
+
'iframeEnabled': true
|
|
149
|
+
}
|
|
150
|
+
let userSync = spec.getUserSyncs(syncOptions, [nativeServerResponse]);
|
|
151
|
+
expect(userSync[0].type).to.equal('iframe');
|
|
152
|
+
const USER_SYNC_URL = 'https://sync.logly.co.jp/sync/sync.html';
|
|
153
|
+
expect(userSync[0].url).to.equal(USER_SYNC_URL);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('When iframeEnabled is false, no userSync should be returned', function () {
|
|
157
|
+
const syncOptions = {
|
|
158
|
+
'iframeEnabled': false
|
|
159
|
+
}
|
|
160
|
+
let userSync = spec.getUserSyncs(syncOptions, [nativeServerResponse]);
|
|
161
|
+
expect(userSync).to.be.an('array').that.is.empty;
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('When nativeServerResponses empty, no userSync should be returned', function () {
|
|
165
|
+
const syncOptions = {
|
|
166
|
+
'iframeEnabled': false
|
|
167
|
+
}
|
|
168
|
+
let userSync = spec.getUserSyncs(syncOptions, []);
|
|
169
|
+
expect(userSync).to.be.an('array').that.is.empty;
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
lotamePanoramaIdSubmodule,
|
|
3
3
|
storage,
|
|
4
4
|
} from 'modules/lotamePanoramaIdSystem.js';
|
|
5
|
+
import { uspDataHandler } from 'src/adapterManager.js';
|
|
5
6
|
import * as utils from 'src/utils.js';
|
|
6
7
|
import { server } from 'test/mocks/xhr.js';
|
|
7
8
|
import sinon from 'sinon';
|
|
@@ -16,6 +17,7 @@ describe('LotameId', function() {
|
|
|
16
17
|
let setLocalStorageStub;
|
|
17
18
|
let removeFromLocalStorageStub;
|
|
18
19
|
let timeStampStub;
|
|
20
|
+
let uspConsentDataStub;
|
|
19
21
|
|
|
20
22
|
const nowTimestamp = new Date().getTime();
|
|
21
23
|
|
|
@@ -30,6 +32,7 @@ describe('LotameId', function() {
|
|
|
30
32
|
'removeDataFromLocalStorage'
|
|
31
33
|
);
|
|
32
34
|
timeStampStub = sinon.stub(utils, 'timestamp').returns(nowTimestamp);
|
|
35
|
+
uspConsentDataStub = sinon.stub(uspDataHandler, 'getConsentData');
|
|
33
36
|
});
|
|
34
37
|
|
|
35
38
|
afterEach(function () {
|
|
@@ -40,6 +43,7 @@ describe('LotameId', function() {
|
|
|
40
43
|
setLocalStorageStub.restore();
|
|
41
44
|
removeFromLocalStorageStub.restore();
|
|
42
45
|
timeStampStub.restore();
|
|
46
|
+
uspConsentDataStub.restore();
|
|
43
47
|
});
|
|
44
48
|
|
|
45
49
|
describe('caching initial data received from the remote server', function () {
|
|
@@ -726,4 +730,227 @@ describe('LotameId', function() {
|
|
|
726
730
|
);
|
|
727
731
|
});
|
|
728
732
|
});
|
|
733
|
+
|
|
734
|
+
describe('with a custom client id', function () {
|
|
735
|
+
describe('with a client expiry set', function () {
|
|
736
|
+
beforeEach(function () {
|
|
737
|
+
getCookieStub
|
|
738
|
+
.withArgs('panoramaId_expiry_1234')
|
|
739
|
+
.returns(String(Date.now() + 500 * 1000));
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
describe('and an existing pano id', function() {
|
|
743
|
+
let submoduleCallback;
|
|
744
|
+
beforeEach(function () {
|
|
745
|
+
getCookieStub
|
|
746
|
+
.withArgs('panoramaId_expiry')
|
|
747
|
+
.returns(String(Date.now() + 100000));
|
|
748
|
+
getCookieStub
|
|
749
|
+
.withArgs('panoramaId')
|
|
750
|
+
.returns(
|
|
751
|
+
'ca22992567e3cd4d116a5899b88a55d0d857a23610db939ae6ac13ba2335d87c'
|
|
752
|
+
);
|
|
753
|
+
submoduleCallback = lotamePanoramaIdSubmodule.getId(
|
|
754
|
+
{
|
|
755
|
+
params: {
|
|
756
|
+
clientId: '1234',
|
|
757
|
+
},
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
gdprApplies: false,
|
|
761
|
+
}
|
|
762
|
+
);
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
it('should not call the remote server when getId is called nor get an id', function () {
|
|
766
|
+
expect(submoduleCallback).to.be.eql({
|
|
767
|
+
id: undefined,
|
|
768
|
+
reason: 'NO_CLIENT_CONSENT',
|
|
769
|
+
});
|
|
770
|
+
});
|
|
771
|
+
});
|
|
772
|
+
|
|
773
|
+
describe('and no existing pano id', function () {
|
|
774
|
+
let submoduleCallback;
|
|
775
|
+
|
|
776
|
+
beforeEach(function () {
|
|
777
|
+
// Let the panoramaId_expiry be empty
|
|
778
|
+
|
|
779
|
+
submoduleCallback = lotamePanoramaIdSubmodule.getId(
|
|
780
|
+
{
|
|
781
|
+
params: {
|
|
782
|
+
clientId: '1234',
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
gdprApplies: false,
|
|
787
|
+
}
|
|
788
|
+
);
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
it('should not call the remote server nor return an id', function () {
|
|
792
|
+
expect(submoduleCallback).to.be.eql({
|
|
793
|
+
id: undefined,
|
|
794
|
+
reason: 'NO_CLIENT_CONSENT',
|
|
795
|
+
});
|
|
796
|
+
});
|
|
797
|
+
});
|
|
798
|
+
});
|
|
799
|
+
|
|
800
|
+
describe('with no client expiry set', function () {
|
|
801
|
+
describe('and no existing pano id', function () {
|
|
802
|
+
let request;
|
|
803
|
+
let callBackSpy = sinon.spy();
|
|
804
|
+
|
|
805
|
+
beforeEach(function () {
|
|
806
|
+
uspConsentDataStub.returns('1NNN');
|
|
807
|
+
let submoduleCallback = lotamePanoramaIdSubmodule.getId(
|
|
808
|
+
{
|
|
809
|
+
params: {
|
|
810
|
+
clientId: '1234',
|
|
811
|
+
},
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
gdprApplies: false,
|
|
815
|
+
}
|
|
816
|
+
).callback;
|
|
817
|
+
submoduleCallback(callBackSpy);
|
|
818
|
+
|
|
819
|
+
request = server.requests[0];
|
|
820
|
+
|
|
821
|
+
request.respond(
|
|
822
|
+
200,
|
|
823
|
+
responseHeader,
|
|
824
|
+
JSON.stringify({
|
|
825
|
+
profile_id: '4ec137245858469eb94a4e248f238694',
|
|
826
|
+
core_id:
|
|
827
|
+
'ca22992567e3cd4d116a5899b88a55d0d857a23610db939ae6ac13ba2335d87f',
|
|
828
|
+
expiry_ts: 3600000,
|
|
829
|
+
})
|
|
830
|
+
);
|
|
831
|
+
});
|
|
832
|
+
|
|
833
|
+
it('should call the remote server when getId is called', function () {
|
|
834
|
+
expect(callBackSpy.calledOnce).to.be.true;
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
it('should pass the usp consent string and client id back', function () {
|
|
838
|
+
expect(request.url).to.be.eq(
|
|
839
|
+
'https://id.crwdcntrl.net/id?gdpr_applies=false&us_privacy=1NNN&c=1234'
|
|
840
|
+
);
|
|
841
|
+
});
|
|
842
|
+
|
|
843
|
+
it('should NOT set an expiry for the client', function () {
|
|
844
|
+
sinon.assert.neverCalledWith(
|
|
845
|
+
setCookieStub,
|
|
846
|
+
'panoramaId_expiry_1234',
|
|
847
|
+
sinon.match.number
|
|
848
|
+
);
|
|
849
|
+
});
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
describe('and an existing pano id', function () {
|
|
853
|
+
let submoduleCallback;
|
|
854
|
+
|
|
855
|
+
beforeEach(function () {
|
|
856
|
+
getCookieStub
|
|
857
|
+
.withArgs('panoramaId_expiry')
|
|
858
|
+
.returns(String(Date.now() + 100000));
|
|
859
|
+
getCookieStub
|
|
860
|
+
.withArgs('panoramaId')
|
|
861
|
+
.returns(
|
|
862
|
+
'ca22992567e3cd4d116a5899b88a55d0d857a23610db939ae6ac13ba2335d87c'
|
|
863
|
+
);
|
|
864
|
+
submoduleCallback = lotamePanoramaIdSubmodule.getId(
|
|
865
|
+
{
|
|
866
|
+
params: {
|
|
867
|
+
clientId: '1234',
|
|
868
|
+
},
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
gdprApplies: false,
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
it('should not call the remote server but use the cached value', function () {
|
|
877
|
+
expect(submoduleCallback).to.be.eql({
|
|
878
|
+
id: 'ca22992567e3cd4d116a5899b88a55d0d857a23610db939ae6ac13ba2335d87c',
|
|
879
|
+
});
|
|
880
|
+
});
|
|
881
|
+
|
|
882
|
+
it('should NOT set an expiry for the client', function () {
|
|
883
|
+
sinon.assert.neverCalledWith(
|
|
884
|
+
setCookieStub,
|
|
885
|
+
'panoramaId_expiry_1234',
|
|
886
|
+
sinon.match.number
|
|
887
|
+
);
|
|
888
|
+
});
|
|
889
|
+
});
|
|
890
|
+
});
|
|
891
|
+
describe('when client consent has errors', function () {
|
|
892
|
+
let request;
|
|
893
|
+
let callBackSpy = sinon.spy();
|
|
894
|
+
|
|
895
|
+
beforeEach(function () {
|
|
896
|
+
let submoduleCallback = lotamePanoramaIdSubmodule.getId(
|
|
897
|
+
{
|
|
898
|
+
params: {
|
|
899
|
+
clientId: '1234',
|
|
900
|
+
},
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
gdprApplies: false,
|
|
904
|
+
}
|
|
905
|
+
).callback;
|
|
906
|
+
submoduleCallback(callBackSpy);
|
|
907
|
+
|
|
908
|
+
request = server.requests[0];
|
|
909
|
+
|
|
910
|
+
request.respond(
|
|
911
|
+
200,
|
|
912
|
+
responseHeader,
|
|
913
|
+
JSON.stringify({
|
|
914
|
+
expiry_ts: 3600000,
|
|
915
|
+
errors: [111],
|
|
916
|
+
no_consent: 'CLIENT',
|
|
917
|
+
})
|
|
918
|
+
);
|
|
919
|
+
});
|
|
920
|
+
|
|
921
|
+
it('should call the remote server when getId is called', function () {
|
|
922
|
+
expect(callBackSpy.calledOnce).to.be.true;
|
|
923
|
+
});
|
|
924
|
+
|
|
925
|
+
it('should pass client id back', function () {
|
|
926
|
+
expect(request.url).to.be.eq(
|
|
927
|
+
'https://id.crwdcntrl.net/id?gdpr_applies=false&c=1234'
|
|
928
|
+
);
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
it('should set the received expiry for the client', function() {
|
|
932
|
+
sinon.assert.calledWith(
|
|
933
|
+
setCookieStub,
|
|
934
|
+
'panoramaId_expiry_1234',
|
|
935
|
+
3600000
|
|
936
|
+
);
|
|
937
|
+
});
|
|
938
|
+
|
|
939
|
+
it('should not clear the cache for the panorama id', function() {
|
|
940
|
+
sinon.assert.neverCalledWith(
|
|
941
|
+
setCookieStub,
|
|
942
|
+
'panoramaId',
|
|
943
|
+
sinon.match.any
|
|
944
|
+
);
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
it('should not clear the cache for the panorama id expiry', function () {
|
|
948
|
+
sinon.assert.neverCalledWith(
|
|
949
|
+
setCookieStub,
|
|
950
|
+
'panoramaId_expiry',
|
|
951
|
+
sinon.match.any
|
|
952
|
+
);
|
|
953
|
+
});
|
|
954
|
+
});
|
|
955
|
+
});
|
|
729
956
|
});
|
|
@@ -167,7 +167,7 @@ describe('MediaSquare bid adapter tests', function () {
|
|
|
167
167
|
});
|
|
168
168
|
it('Verifies user sync without cookie in bid response', function () {
|
|
169
169
|
var syncs = spec.getUserSyncs({}, [BID_RESPONSE], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
|
|
170
|
-
expect(syncs).to.have.
|
|
170
|
+
expect(syncs).to.have.lengthOf(0);
|
|
171
171
|
});
|
|
172
172
|
it('Verifies user sync with cookies in bid response', function () {
|
|
173
173
|
BID_RESPONSE.body.cookies = [{'type': 'image', 'url': 'http://www.cookie.sync.org/'}];
|
|
@@ -178,13 +178,13 @@ describe('MediaSquare bid adapter tests', function () {
|
|
|
178
178
|
});
|
|
179
179
|
it('Verifies user sync with no bid response', function() {
|
|
180
180
|
var syncs = spec.getUserSyncs({}, null, DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
|
|
181
|
-
expect(syncs).to.have.
|
|
181
|
+
expect(syncs).to.have.lengthOf(0);
|
|
182
182
|
});
|
|
183
183
|
it('Verifies user sync with no bid body response', function() {
|
|
184
184
|
var syncs = spec.getUserSyncs({}, [], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
|
|
185
|
-
expect(syncs).to.have.
|
|
185
|
+
expect(syncs).to.have.lengthOf(0);
|
|
186
186
|
var syncs = spec.getUserSyncs({}, [{}], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
|
|
187
|
-
expect(syncs).to.have.
|
|
187
|
+
expect(syncs).to.have.lengthOf(0);
|
|
188
188
|
});
|
|
189
189
|
it('Verifies native in bid response', function () {
|
|
190
190
|
const request = spec.buildRequests(NATIVE_PARAMS, DEFAULT_OPTIONS);
|
|
@@ -4,6 +4,7 @@ import { spec } from 'modules/nextMillenniumBidAdapter.js';
|
|
|
4
4
|
describe('nextMillenniumBidAdapterTests', function() {
|
|
5
5
|
const bidRequestData = [
|
|
6
6
|
{
|
|
7
|
+
adUnitCode: 'test-div',
|
|
7
8
|
bidId: 'bid1234',
|
|
8
9
|
auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
|
|
9
10
|
bidder: 'nextMillennium',
|
|
@@ -17,19 +18,43 @@ describe('nextMillenniumBidAdapterTests', function() {
|
|
|
17
18
|
}
|
|
18
19
|
];
|
|
19
20
|
|
|
20
|
-
it('Request params check with GDPR Consent', function () {
|
|
21
|
+
it('Request params check with GDPR and USP Consent', function () {
|
|
21
22
|
const request = spec.buildRequests(bidRequestData, bidRequestData[0]);
|
|
22
23
|
expect(JSON.parse(request[0].data).user.ext.consent).to.equal('kjfdniwjnifwenrif3');
|
|
23
24
|
expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('1---');
|
|
24
25
|
expect(JSON.parse(request[0].data).regs.ext.gdpr).to.equal(1);
|
|
25
26
|
});
|
|
26
27
|
|
|
28
|
+
it('Request params check without GDPR Consent', function () {
|
|
29
|
+
delete bidRequestData[0].gdprConsent
|
|
30
|
+
const request = spec.buildRequests(bidRequestData, bidRequestData[0]);
|
|
31
|
+
expect(JSON.parse(request[0].data).regs.ext.gdpr).to.be.undefined;
|
|
32
|
+
expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('1---');
|
|
33
|
+
});
|
|
34
|
+
|
|
27
35
|
it('validate_generated_params', function() {
|
|
28
36
|
const request = spec.buildRequests(bidRequestData);
|
|
29
37
|
expect(request[0].bidId).to.equal('bid1234');
|
|
30
38
|
expect(JSON.parse(request[0].data).id).to.equal('b06c5141-fe8f-4cdf-9d7d-54415490a917');
|
|
31
39
|
});
|
|
32
40
|
|
|
41
|
+
it('Check if refresh_count param is incremented', function() {
|
|
42
|
+
const request = spec.buildRequests(bidRequestData);
|
|
43
|
+
expect(JSON.parse(request[0].data).ext.nextMillennium.refresh_count).to.equal(3);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('Test getUserSyncs function', function () {
|
|
47
|
+
const syncOptions = {
|
|
48
|
+
'iframeEnabled': true
|
|
49
|
+
}
|
|
50
|
+
const userSync = spec.getUserSyncs(syncOptions);
|
|
51
|
+
expect(userSync).to.be.an('array').with.lengthOf(1);
|
|
52
|
+
expect(userSync[0].type).to.exist;
|
|
53
|
+
expect(userSync[0].url).to.exist;
|
|
54
|
+
expect(userSync[0].type).to.be.equal('iframe');
|
|
55
|
+
expect(userSync[0].url).to.be.equal('https://statics.nextmillmedia.com/load-cookie.html?v=4');
|
|
56
|
+
});
|
|
57
|
+
|
|
33
58
|
it('validate_response_params', function() {
|
|
34
59
|
const serverResponse = {
|
|
35
60
|
body: {
|
|
@@ -268,6 +268,10 @@ describe('OguryBidAdapter', function () {
|
|
|
268
268
|
ext: {
|
|
269
269
|
consent: bidderRequest.gdprConsent.consentString
|
|
270
270
|
},
|
|
271
|
+
},
|
|
272
|
+
ext: {
|
|
273
|
+
prebidversion: '$prebid.version$',
|
|
274
|
+
adapterversion: '1.2.7'
|
|
271
275
|
}
|
|
272
276
|
};
|
|
273
277
|
|
|
@@ -425,7 +429,9 @@ describe('OguryBidAdapter', function () {
|
|
|
425
429
|
meta: {
|
|
426
430
|
advertiserDomains: openRtbBidResponse.body.seatbid[0].bid[0].adomain
|
|
427
431
|
},
|
|
428
|
-
nurl: openRtbBidResponse.body.seatbid[0].bid[0].nurl
|
|
432
|
+
nurl: openRtbBidResponse.body.seatbid[0].bid[0].nurl,
|
|
433
|
+
adapterVersion: '1.2.7',
|
|
434
|
+
prebidVersion: '$prebid.version$'
|
|
429
435
|
}, {
|
|
430
436
|
requestId: openRtbBidResponse.body.seatbid[0].bid[1].impid,
|
|
431
437
|
cpm: openRtbBidResponse.body.seatbid[0].bid[1].price,
|
|
@@ -440,7 +446,9 @@ describe('OguryBidAdapter', function () {
|
|
|
440
446
|
meta: {
|
|
441
447
|
advertiserDomains: openRtbBidResponse.body.seatbid[0].bid[1].adomain
|
|
442
448
|
},
|
|
443
|
-
nurl: openRtbBidResponse.body.seatbid[0].bid[1].nurl
|
|
449
|
+
nurl: openRtbBidResponse.body.seatbid[0].bid[1].nurl,
|
|
450
|
+
adapterVersion: '1.2.7',
|
|
451
|
+
prebidVersion: '$prebid.version$'
|
|
444
452
|
}]
|
|
445
453
|
|
|
446
454
|
let request = spec.buildRequests(bidRequests, bidderRequest);
|
|
@@ -35,17 +35,30 @@ describe('Optimera RTD score file properly sets targeting values', () => {
|
|
|
35
35
|
'de': {
|
|
36
36
|
'div-0': ['A5', 'A6'],
|
|
37
37
|
'div-1': ['A7', 'A8'],
|
|
38
|
+
'insights': {
|
|
39
|
+
'ilv': ['div-0'],
|
|
40
|
+
'miv': ['div-4'],
|
|
41
|
+
}
|
|
38
42
|
},
|
|
39
43
|
'mo': {
|
|
40
44
|
'div-0': ['A9', 'B0'],
|
|
41
45
|
'div-1': ['B1', 'B2'],
|
|
46
|
+
'insights': {
|
|
47
|
+
'ilv': ['div-1'],
|
|
48
|
+
'miv': ['div-2'],
|
|
49
|
+
}
|
|
42
50
|
}
|
|
51
|
+
},
|
|
52
|
+
'insights': {
|
|
53
|
+
'ilv': ['div-5'],
|
|
54
|
+
'miv': ['div-6'],
|
|
43
55
|
}
|
|
44
56
|
};
|
|
45
|
-
it('Properly set the score file url', () => {
|
|
57
|
+
it('Properly set the score file url and scores', () => {
|
|
46
58
|
optimeraRTD.setScores(JSON.stringify(scores));
|
|
47
59
|
expect(optimeraRTD.optimeraTargeting['div-0']).to.include.ordered.members(['A5', 'A6']);
|
|
48
60
|
expect(optimeraRTD.optimeraTargeting['div-1']).to.include.ordered.members(['A7', 'A8']);
|
|
61
|
+
expect(window.optimeraInsights.data['ilv']).to.include.ordered.members(['div-0']);
|
|
49
62
|
});
|
|
50
63
|
});
|
|
51
64
|
|