prebid.js 8.6.0 → 8.8.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/a1MediaRtdProvider.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admaticBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adqueryIdSystem.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adsinteractiveBidAdapter.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/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/automatadAnalyticsAdapter.js +1 -0
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidViewability.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connatixBidAdapter.js +1 -0
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +7 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freepassBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/geoedgeRtdProvider.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.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/medianetBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nativoBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +145 -142
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/operaadsBidAdapter.js +1 -1
- package/dist/operaadsIdSystem.js +1 -0
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.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/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smartyadsBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/snigelBidAdapter.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/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/topicsFpdModule.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/topics/topics-server.js +72 -0
- package/modules/.submodules.json +2 -1
- package/modules/a1MediaRtdProvider.js +1 -1
- package/modules/adagioBidAdapter.js +15 -1
- package/modules/adgenerationBidAdapter.js +4 -3
- package/modules/admaticBidAdapter.js +5 -0
- package/modules/adqueryBidAdapter.js +23 -21
- package/modules/adqueryIdSystem.js +45 -30
- package/modules/adrelevantisBidAdapter.js +2 -0
- package/modules/adsinteractiveBidAdapter.js +2 -0
- package/modules/alkimiBidAdapter.js +19 -7
- package/modules/automatadAnalyticsAdapter.js +325 -0
- package/modules/automatadAnalyticsAdapter.md +23 -0
- package/modules/bidViewability.js +7 -0
- package/modules/bidViewability.md +9 -8
- package/modules/brandmetricsRtdProvider.js +30 -27
- package/modules/connatixBidAdapter.js +185 -0
- package/modules/connatixBidAdapter.md +37 -0
- package/modules/criteoBidAdapter.js +73 -50
- package/modules/freepassBidAdapter.js +20 -1
- package/modules/freepassBidAdapter.md +4 -1
- package/modules/geoedgeRtdProvider.js +43 -13
- package/modules/geoedgeRtdProvider.md +2 -1
- package/modules/gridBidAdapter.js +1 -8
- package/modules/liveIntentIdSystem.js +16 -1
- package/modules/medianetBidAdapter.js +7 -4
- package/modules/mediasquareBidAdapter.js +3 -0
- package/modules/nativoBidAdapter.js +21 -3
- package/modules/onetagBidAdapter.js +3 -0
- package/modules/operaadsBidAdapter.js +5 -0
- package/modules/operaadsBidAdapter.md +5 -5
- package/modules/operaadsIdSystem.js +106 -0
- package/modules/operaadsIdSystem.md +52 -0
- package/modules/optidigitalBidAdapter.js +25 -16
- package/modules/oxxionAnalyticsAdapter.js +22 -5
- package/modules/rubiconBidAdapter.js +2 -2
- package/modules/smartyadsBidAdapter.js +18 -1
- package/modules/snigelBidAdapter.js +69 -16
- package/modules/snigelBidAdapter.md +9 -3
- package/modules/tappxBidAdapter.js +17 -14
- package/modules/topicsFpdModule.js +35 -9
- package/modules/undertoneBidAdapter.md +1 -1
- package/modules/userId/eids.md +7 -0
- package/modules/visxBidAdapter.js +51 -1
- package/package.json +2 -2
- package/src/adloader.js +1 -0
- package/src/native.js +2 -2
- package/test/spec/modules/adagioBidAdapter_spec.js +89 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
- package/test/spec/modules/admaticBidAdapter_spec.js +5 -0
- package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
- package/test/spec/modules/alkimiBidAdapter_spec.js +3 -9
- package/test/spec/modules/automatadAnalyticsAdapter_spec.js +533 -0
- package/test/spec/modules/bidViewability_spec.js +32 -1
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
- package/test/spec/modules/connatixBidAdapter_spec.js +366 -0
- package/test/spec/modules/criteoBidAdapter_spec.js +249 -0
- package/test/spec/modules/eids_spec.js +48 -0
- package/test/spec/modules/freepassBidAdapter_spec.js +44 -0
- package/test/spec/modules/geoedgeRtdProvider_spec.js +44 -24
- package/test/spec/modules/gridBidAdapter_spec.js +68 -0
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
- package/test/spec/modules/medianetBidAdapter_spec.js +18 -18
- package/test/spec/modules/mediasquareBidAdapter_spec.js +5 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +6 -1
- package/test/spec/modules/onetagBidAdapter_spec.js +69 -0
- package/test/spec/modules/operaadsIdSystem_spec.js +53 -0
- package/test/spec/modules/optidigitalBidAdapter_spec.js +9 -2
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +6 -1
- package/test/spec/modules/rubiconBidAdapter_spec.js +24 -0
- package/test/spec/modules/smartyadsBidAdapter_spec.js +49 -0
- package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
- package/test/spec/modules/tappxBidAdapter_spec.js +19 -0
- package/test/spec/modules/topicsFpdModule_spec.js +102 -1
- package/test/spec/modules/visxBidAdapter_spec.js +151 -1
- package/test/spec/native_spec.js +5 -3
|
@@ -271,6 +271,39 @@ describe('eids array generation for known sub-modules', function() {
|
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
+
it('index', function() {
|
|
275
|
+
const userId = {
|
|
276
|
+
index: {'id': 'sample_id'}
|
|
277
|
+
};
|
|
278
|
+
const newEids = createEidsArray(userId);
|
|
279
|
+
expect(newEids.length).to.equal(1);
|
|
280
|
+
expect(newEids[0]).to.deep.equal({
|
|
281
|
+
source: 'liveintent.indexexchange.com',
|
|
282
|
+
uids: [{
|
|
283
|
+
id: 'sample_id',
|
|
284
|
+
atype: 3
|
|
285
|
+
}]
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it('index with ext', function() {
|
|
290
|
+
const userId = {
|
|
291
|
+
index: {'id': 'sample_id', 'ext': {'provider': 'some.provider.com'}}
|
|
292
|
+
};
|
|
293
|
+
const newEids = createEidsArray(userId);
|
|
294
|
+
expect(newEids.length).to.equal(1);
|
|
295
|
+
expect(newEids[0]).to.deep.equal({
|
|
296
|
+
source: 'liveintent.indexexchange.com',
|
|
297
|
+
uids: [{
|
|
298
|
+
id: 'sample_id',
|
|
299
|
+
atype: 3,
|
|
300
|
+
ext: {
|
|
301
|
+
provider: 'some.provider.com'
|
|
302
|
+
}
|
|
303
|
+
}]
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
|
|
274
307
|
it('liveIntentId; getValue call and NO ext', function() {
|
|
275
308
|
const userId = {
|
|
276
309
|
lipb: {
|
|
@@ -547,6 +580,21 @@ describe('eids array generation for known sub-modules', function() {
|
|
|
547
580
|
});
|
|
548
581
|
});
|
|
549
582
|
|
|
583
|
+
it('operaId', function() {
|
|
584
|
+
const userId = {
|
|
585
|
+
operaId: 'some-random-id-value'
|
|
586
|
+
};
|
|
587
|
+
const newEids = createEidsArray(userId);
|
|
588
|
+
expect(newEids.length).to.equal(1);
|
|
589
|
+
expect(newEids[0]).to.deep.equal({
|
|
590
|
+
source: 't.adx.opera.com',
|
|
591
|
+
uids: [{
|
|
592
|
+
id: 'some-random-id-value',
|
|
593
|
+
atype: 1
|
|
594
|
+
}]
|
|
595
|
+
});
|
|
596
|
+
});
|
|
597
|
+
|
|
550
598
|
it('33acrossId', function() {
|
|
551
599
|
const userId = {
|
|
552
600
|
'33acrossId': {
|
|
@@ -19,6 +19,9 @@ describe('FreePass adapter', function () {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
adUnitCode: 'adunit-code',
|
|
22
|
+
params: {
|
|
23
|
+
publisherId: 'publisherIdValue'
|
|
24
|
+
}
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
it('should return true when required params found', function () {
|
|
@@ -30,6 +33,12 @@ describe('FreePass adapter', function () {
|
|
|
30
33
|
delete localBid.adUnitCode;
|
|
31
34
|
expect(spec.isBidRequestValid(localBid)).to.equal(false);
|
|
32
35
|
});
|
|
36
|
+
|
|
37
|
+
it('should return false when params.publisherId is missing', function () {
|
|
38
|
+
let localBid = Object.assign({}, bid);
|
|
39
|
+
delete localBid.params.publisherId;
|
|
40
|
+
expect(spec.isBidRequestValid(localBid)).to.equal(false);
|
|
41
|
+
});
|
|
33
42
|
});
|
|
34
43
|
|
|
35
44
|
describe('buildRequests', function () {
|
|
@@ -43,6 +52,10 @@ describe('FreePass adapter', function () {
|
|
|
43
52
|
'userId': '56c4c789-71ce-46f5-989e-9e543f3d5f96',
|
|
44
53
|
'commonId': 'commonIdValue'
|
|
45
54
|
}
|
|
55
|
+
},
|
|
56
|
+
'adUnitCode': 'adunit-code',
|
|
57
|
+
'params': {
|
|
58
|
+
'publisherId': 'publisherIdValue'
|
|
46
59
|
}
|
|
47
60
|
}];
|
|
48
61
|
bidderRequest = {};
|
|
@@ -108,6 +121,33 @@ describe('FreePass adapter', function () {
|
|
|
108
121
|
expect(ortbData.device.ext).to.be.an('object');
|
|
109
122
|
expect(ortbData.device.ext.is_accurate_ip).to.equal(0);
|
|
110
123
|
});
|
|
124
|
+
|
|
125
|
+
it('it should add publisher related information w/o publisherUrl', function () {
|
|
126
|
+
const bidRequest = spec.buildRequests(bidRequests, bidderRequest);
|
|
127
|
+
const ortbData = bidRequest.data;
|
|
128
|
+
expect(ortbData.site).to.be.an('object');
|
|
129
|
+
expect(ortbData.site.publisher.id).to.equal('publisherIdValue');
|
|
130
|
+
// publisher.domain is optional
|
|
131
|
+
expect(ortbData.site.publisher.domain).to.be.undefined;
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('it should add publisher related information w/ publisherUrl', function () {
|
|
135
|
+
const PUBLISHER_URL = 'publisherUrlValue';
|
|
136
|
+
let localBidRequests = [Object.assign({}, bidRequests[0])];
|
|
137
|
+
localBidRequests[0].params.publisherUrl = PUBLISHER_URL;
|
|
138
|
+
const bidRequest = spec.buildRequests(localBidRequests, bidderRequest);
|
|
139
|
+
const ortbData = bidRequest.data;
|
|
140
|
+
expect(ortbData.site).to.be.an('object');
|
|
141
|
+
expect(ortbData.site.publisher.id).to.equal('publisherIdValue');
|
|
142
|
+
// publisher.domain is optional. set when given
|
|
143
|
+
expect(ortbData.site.publisher.domain).to.equal(PUBLISHER_URL);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('it should imp.tagId from adUnitCode', function () {
|
|
147
|
+
const bidRequest = spec.buildRequests(bidRequests, bidderRequest);
|
|
148
|
+
const ortbData = bidRequest.data;
|
|
149
|
+
expect(ortbData.imp[0].tagId).to.equal('adunit-code');
|
|
150
|
+
});
|
|
111
151
|
});
|
|
112
152
|
|
|
113
153
|
describe('interpretResponse', function () {
|
|
@@ -122,6 +162,10 @@ describe('FreePass adapter', function () {
|
|
|
122
162
|
'userId': '56c4c789-71ce-46f5-989e-9e543f3d5f96',
|
|
123
163
|
'commonId': 'commonIdValue'
|
|
124
164
|
}
|
|
165
|
+
},
|
|
166
|
+
'adUnitCode': 'adunit-code',
|
|
167
|
+
'params': {
|
|
168
|
+
'publisherId': 'publisherIdValue'
|
|
125
169
|
}
|
|
126
170
|
}];
|
|
127
171
|
bidderRequest = {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as utils from '../../../src/utils.js';
|
|
2
|
+
import { loadExternalScript } from '../../../src/adloader.js';
|
|
2
3
|
import * as hook from '../../../src/hook.js'
|
|
3
|
-
import { beforeInit, geoedgeSubmodule, setWrapper, wrapper, htmlPlaceholder, WRAPPER_URL, getClientUrl } from '../../../modules/geoedgeRtdProvider.js';
|
|
4
|
+
import { beforeInit, geoedgeSubmodule, setWrapper, wrapper, htmlPlaceholder, WRAPPER_URL, getClientUrl, getInPageUrl } from '../../../modules/geoedgeRtdProvider.js';
|
|
4
5
|
import { server } from '../../../test/mocks/xhr.js';
|
|
5
6
|
import * as events from '../../../src/events.js';
|
|
6
7
|
import CONSTANTS from '../../../src/constants.json';
|
|
7
8
|
|
|
8
9
|
let key = '123123123';
|
|
9
|
-
function makeConfig() {
|
|
10
|
+
function makeConfig(gpt) {
|
|
10
11
|
return {
|
|
11
12
|
name: 'geoedge',
|
|
12
13
|
params: {
|
|
@@ -15,7 +16,8 @@ function makeConfig() {
|
|
|
15
16
|
bidders: {
|
|
16
17
|
bidderA: true,
|
|
17
18
|
bidderB: false
|
|
18
|
-
}
|
|
19
|
+
},
|
|
20
|
+
gpt: gpt
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
23
|
}
|
|
@@ -23,6 +25,7 @@ function makeConfig() {
|
|
|
23
25
|
function mockBid(bidderCode) {
|
|
24
26
|
return {
|
|
25
27
|
'ad': '<creative/>',
|
|
28
|
+
'adId': '1234',
|
|
26
29
|
'cpm': '1.00',
|
|
27
30
|
'width': 300,
|
|
28
31
|
'height': 250,
|
|
@@ -35,6 +38,15 @@ function mockBid(bidderCode) {
|
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
|
|
41
|
+
function mockMessageFromClient(key) {
|
|
42
|
+
return {
|
|
43
|
+
key,
|
|
44
|
+
impression: true,
|
|
45
|
+
adId: 1234,
|
|
46
|
+
type: 'impression'
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
let mockWrapper = `<wrapper>${htmlPlaceholder}</wrapper>`;
|
|
39
51
|
|
|
40
52
|
describe('Geoedge RTD module', function () {
|
|
@@ -47,22 +59,11 @@ describe('Geoedge RTD module', function () {
|
|
|
47
59
|
after(function () {
|
|
48
60
|
submoduleStub.restore();
|
|
49
61
|
});
|
|
50
|
-
it('should fetch the wrapper', function () {
|
|
51
|
-
beforeInit();
|
|
52
|
-
let request = server.requests[0];
|
|
53
|
-
let isWrapperRequest = request && request.url && request.url && request.url === WRAPPER_URL;
|
|
54
|
-
expect(isWrapperRequest).to.equal(true);
|
|
55
|
-
});
|
|
56
62
|
it('should register RTD submodule provider', function () {
|
|
63
|
+
beforeInit();
|
|
57
64
|
expect(submoduleStub.calledWith('realTimeData', geoedgeSubmodule)).to.equal(true);
|
|
58
65
|
});
|
|
59
66
|
});
|
|
60
|
-
describe('setWrapper', function () {
|
|
61
|
-
it('should set the wrapper', function () {
|
|
62
|
-
setWrapper(mockWrapper);
|
|
63
|
-
expect(wrapper).to.equal(mockWrapper);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
67
|
describe('submodule', function () {
|
|
67
68
|
describe('name', function () {
|
|
68
69
|
it('should be geoedge', function () {
|
|
@@ -84,35 +85,54 @@ describe('Geoedge RTD module', function () {
|
|
|
84
85
|
expect(missingParams || missingKey).to.equal(false);
|
|
85
86
|
});
|
|
86
87
|
it('should return true when params are ok', function () {
|
|
87
|
-
expect(geoedgeSubmodule.init(makeConfig())).to.equal(true);
|
|
88
|
+
expect(geoedgeSubmodule.init(makeConfig(false))).to.equal(true);
|
|
89
|
+
});
|
|
90
|
+
it('should fetch the wrapper', function () {
|
|
91
|
+
geoedgeSubmodule.init(makeConfig(false));
|
|
92
|
+
let request = server.requests[0];
|
|
93
|
+
let isWrapperRequest = request && request.url && request.url && request.url === WRAPPER_URL;
|
|
94
|
+
expect(isWrapperRequest).to.equal(true);
|
|
88
95
|
});
|
|
89
96
|
it('should preload the client', function () {
|
|
90
97
|
let isLinkPreloadAsScript = arg => arg.tagName === 'LINK' && arg.rel === 'preload' && arg.as === 'script' && arg.href === getClientUrl(key);
|
|
91
98
|
expect(insertElementStub.calledWith(sinon.match(isLinkPreloadAsScript))).to.equal(true);
|
|
92
99
|
});
|
|
93
|
-
it('should emit billable events with applicable winning bids', function () {
|
|
94
|
-
let applicableBid = mockBid('bidderA');
|
|
95
|
-
let nonApplicableBid = mockBid('bidderB');
|
|
100
|
+
it('should emit billable events with applicable winning bids', function (done) {
|
|
96
101
|
let counter = 0;
|
|
97
102
|
events.on(CONSTANTS.EVENTS.BILLABLE_EVENT, function (event) {
|
|
98
103
|
if (event.vendor === 'geoedge' && event.type === 'impression') {
|
|
99
104
|
counter += 1;
|
|
100
105
|
}
|
|
106
|
+
expect(counter).to.equal(1);
|
|
107
|
+
done();
|
|
101
108
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
window.postMessage(mockMessageFromClient(key), '*');
|
|
110
|
+
});
|
|
111
|
+
it('should load the in page code when gpt params is true', function () {
|
|
112
|
+
geoedgeSubmodule.init(makeConfig(true));
|
|
113
|
+
let isInPageUrl = arg => arg == getInPageUrl(key);
|
|
114
|
+
expect(loadExternalScript.calledWith(sinon.match(isInPageUrl))).to.equal(true);
|
|
115
|
+
});
|
|
116
|
+
it('should set the window.grumi config object when gpt params is true', function () {
|
|
117
|
+
let hasGrumiObj = typeof window.grumi === 'object';
|
|
118
|
+
expect(hasGrumiObj && window.grumi.key === key && window.grumi.fromPrebid).to.equal(true);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
describe('setWrapper', function () {
|
|
122
|
+
it('should set the wrapper', function () {
|
|
123
|
+
setWrapper(mockWrapper);
|
|
124
|
+
expect(wrapper).to.equal(mockWrapper);
|
|
105
125
|
});
|
|
106
126
|
});
|
|
107
127
|
describe('onBidResponseEvent', function () {
|
|
108
128
|
let bidFromA = mockBid('bidderA');
|
|
109
129
|
it('should wrap bid html when bidder is configured', function () {
|
|
110
|
-
geoedgeSubmodule.onBidResponseEvent(bidFromA, makeConfig());
|
|
130
|
+
geoedgeSubmodule.onBidResponseEvent(bidFromA, makeConfig(false));
|
|
111
131
|
expect(bidFromA.ad.indexOf('<wrapper>')).to.equal(0);
|
|
112
132
|
});
|
|
113
133
|
it('should not wrap bid html when bidder is not configured', function () {
|
|
114
134
|
let bidFromB = mockBid('bidderB');
|
|
115
|
-
geoedgeSubmodule.onBidResponseEvent(bidFromB, makeConfig());
|
|
135
|
+
geoedgeSubmodule.onBidResponseEvent(bidFromB, makeConfig(false));
|
|
116
136
|
expect(bidFromB.ad.indexOf('<wrapper>')).to.equal(-1);
|
|
117
137
|
});
|
|
118
138
|
it('should only muatate the bid ad porperty', function () {
|
|
@@ -786,6 +786,74 @@ describe('TheMediaGrid Adapter', function () {
|
|
|
786
786
|
});
|
|
787
787
|
});
|
|
788
788
|
|
|
789
|
+
it('should prioritize pbadslot over adslot', function() {
|
|
790
|
+
const ortb2Imp = [{
|
|
791
|
+
ext: {
|
|
792
|
+
data: {
|
|
793
|
+
adserver: {
|
|
794
|
+
adslot: 'adslot'
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}, {
|
|
799
|
+
ext: {
|
|
800
|
+
data: {
|
|
801
|
+
adserver: {
|
|
802
|
+
adslot: 'adslot'
|
|
803
|
+
},
|
|
804
|
+
pbadslot: 'pbadslot'
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}];
|
|
808
|
+
const bidRequestsWithOrtb2Imp = bidRequests.slice(0, 2).map((bid, ind) => {
|
|
809
|
+
return Object.assign({}, bid, ortb2Imp[ind] ? { ortb2Imp: {...bid.ortb2Imp, ...ortb2Imp[ind]} } : {});
|
|
810
|
+
});
|
|
811
|
+
const [request] = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
|
|
812
|
+
expect(request.data).to.be.an('string');
|
|
813
|
+
const payload = parseRequest(request.data);
|
|
814
|
+
expect(payload.imp[0].ext.gpid).to.equal(ortb2Imp[0].ext.data.adserver.adslot);
|
|
815
|
+
expect(payload.imp[1].ext.gpid).to.equal(ortb2Imp[1].ext.data.pbadslot);
|
|
816
|
+
});
|
|
817
|
+
|
|
818
|
+
it('should prioritize gpid over pbadslot and adslot', function() {
|
|
819
|
+
const ortb2Imp = [{
|
|
820
|
+
ext: {
|
|
821
|
+
gpid: 'gpid',
|
|
822
|
+
data: {
|
|
823
|
+
adserver: {
|
|
824
|
+
adslot: 'adslot'
|
|
825
|
+
},
|
|
826
|
+
pbadslot: 'pbadslot'
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}, {
|
|
830
|
+
ext: {
|
|
831
|
+
gpid: 'gpid',
|
|
832
|
+
data: {
|
|
833
|
+
adserver: {
|
|
834
|
+
adslot: 'adslot'
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}, {
|
|
839
|
+
ext: {
|
|
840
|
+
gpid: 'gpid',
|
|
841
|
+
data: {
|
|
842
|
+
pbadslot: 'pbadslot'
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}];
|
|
846
|
+
const bidRequestsWithOrtb2Imp = bidRequests.slice(0, 3).map((bid, ind) => {
|
|
847
|
+
return Object.assign({}, bid, ortb2Imp[ind] ? { ortb2Imp: {...bid.ortb2Imp, ...ortb2Imp[ind]} } : {});
|
|
848
|
+
});
|
|
849
|
+
const [request] = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
|
|
850
|
+
expect(request.data).to.be.an('string');
|
|
851
|
+
const payload = parseRequest(request.data);
|
|
852
|
+
expect(payload.imp[0].ext.gpid).to.equal(ortb2Imp[0].ext.gpid);
|
|
853
|
+
expect(payload.imp[1].ext.gpid).to.equal(ortb2Imp[1].ext.gpid);
|
|
854
|
+
expect(payload.imp[2].ext.gpid).to.equal(ortb2Imp[2].ext.gpid);
|
|
855
|
+
});
|
|
856
|
+
|
|
789
857
|
it('should contain imp[].instl if available', function() {
|
|
790
858
|
const ortb2Imp = [{
|
|
791
859
|
instl: 1
|
|
@@ -266,6 +266,11 @@ describe('LiveIntentMinimalId', function() {
|
|
|
266
266
|
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
|
|
267
267
|
});
|
|
268
268
|
|
|
269
|
+
it('should decode an index id to a seperate object when present', function() {
|
|
270
|
+
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', index: 'bar' });
|
|
271
|
+
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'index': 'bar'}, 'index': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
|
|
272
|
+
});
|
|
273
|
+
|
|
269
274
|
it('should allow disabling nonId resolution', function() {
|
|
270
275
|
let callBackSpy = sinon.spy();
|
|
271
276
|
let submoduleCallback = liveIntentIdSubmodule.getId({ params: {
|
|
@@ -378,6 +378,11 @@ describe('LiveIntentId', function() {
|
|
|
378
378
|
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
|
|
379
379
|
});
|
|
380
380
|
|
|
381
|
+
it('should decode an index id to a seperate object when present', function() {
|
|
382
|
+
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', index: 'bar' });
|
|
383
|
+
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'index': 'bar'}, 'index': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
|
|
384
|
+
});
|
|
385
|
+
|
|
381
386
|
it('should allow disabling nonId resolution', function() {
|
|
382
387
|
let callBackSpy = sinon.spy();
|
|
383
388
|
let submoduleCallback = liveIntentIdSubmodule.getId({ params: {
|
|
@@ -915,24 +915,24 @@ let VALID_BID_REQUEST = [{
|
|
|
915
915
|
cid: '8CUV090'
|
|
916
916
|
}
|
|
917
917
|
},
|
|
918
|
-
|
|
919
|
-
bidder: '
|
|
918
|
+
VALID_PARAMS_TS = {
|
|
919
|
+
bidder: 'trustedstack',
|
|
920
920
|
params: {
|
|
921
|
-
cid: '
|
|
921
|
+
cid: 'TS012345'
|
|
922
922
|
}
|
|
923
923
|
},
|
|
924
924
|
PARAMS_MISSING = {
|
|
925
925
|
bidder: 'medianet',
|
|
926
926
|
},
|
|
927
|
-
|
|
928
|
-
bidder: '
|
|
927
|
+
PARAMS_MISSING_TS = {
|
|
928
|
+
bidder: 'trustedstack',
|
|
929
929
|
},
|
|
930
930
|
PARAMS_WITHOUT_CID = {
|
|
931
931
|
bidder: 'medianet',
|
|
932
932
|
params: {}
|
|
933
933
|
},
|
|
934
|
-
|
|
935
|
-
bidder: '
|
|
934
|
+
PARAMS_WITHOUT_CID_TS = {
|
|
935
|
+
bidder: 'trustedstack',
|
|
936
936
|
params: {}
|
|
937
937
|
},
|
|
938
938
|
PARAMS_WITH_INTEGER_CID = {
|
|
@@ -941,8 +941,8 @@ let VALID_BID_REQUEST = [{
|
|
|
941
941
|
cid: 8867587
|
|
942
942
|
}
|
|
943
943
|
},
|
|
944
|
-
|
|
945
|
-
bidder: '
|
|
944
|
+
PARAMS_WITH_INTEGER_CID_TS = {
|
|
945
|
+
bidder: 'trustedstack',
|
|
946
946
|
params: {
|
|
947
947
|
cid: 8867587
|
|
948
948
|
}
|
|
@@ -953,8 +953,8 @@ let VALID_BID_REQUEST = [{
|
|
|
953
953
|
cid: ''
|
|
954
954
|
}
|
|
955
955
|
},
|
|
956
|
-
|
|
957
|
-
bidder: '
|
|
956
|
+
PARAMS_WITH_EMPTY_CID_TS = {
|
|
957
|
+
bidder: 'trustedstack',
|
|
958
958
|
params: {
|
|
959
959
|
cid: ''
|
|
960
960
|
}
|
|
@@ -1783,34 +1783,34 @@ describe('Media.net bid adapter', function () {
|
|
|
1783
1783
|
});
|
|
1784
1784
|
});
|
|
1785
1785
|
|
|
1786
|
-
describe('isBidRequestValid
|
|
1786
|
+
describe('isBidRequestValid trustedstack', function () {
|
|
1787
1787
|
it('should accept valid bid params', function () {
|
|
1788
|
-
let isValid = spec.isBidRequestValid(
|
|
1788
|
+
let isValid = spec.isBidRequestValid(VALID_PARAMS_TS);
|
|
1789
1789
|
expect(isValid).to.equal(true);
|
|
1790
1790
|
});
|
|
1791
1791
|
|
|
1792
1792
|
it('should reject bid if cid is not present', function () {
|
|
1793
|
-
let isValid = spec.isBidRequestValid(
|
|
1793
|
+
let isValid = spec.isBidRequestValid(PARAMS_WITHOUT_CID_TS);
|
|
1794
1794
|
expect(isValid).to.equal(false);
|
|
1795
1795
|
});
|
|
1796
1796
|
|
|
1797
1797
|
it('should reject bid if cid is not a string', function () {
|
|
1798
|
-
let isValid = spec.isBidRequestValid(
|
|
1798
|
+
let isValid = spec.isBidRequestValid(PARAMS_WITH_INTEGER_CID_TS);
|
|
1799
1799
|
expect(isValid).to.equal(false);
|
|
1800
1800
|
});
|
|
1801
1801
|
|
|
1802
1802
|
it('should reject bid if cid is a empty string', function () {
|
|
1803
|
-
let isValid = spec.isBidRequestValid(
|
|
1803
|
+
let isValid = spec.isBidRequestValid(PARAMS_WITH_EMPTY_CID_TS);
|
|
1804
1804
|
expect(isValid).to.equal(false);
|
|
1805
1805
|
});
|
|
1806
1806
|
|
|
1807
1807
|
it('should have missing params', function () {
|
|
1808
|
-
let isValid = spec.isBidRequestValid(
|
|
1808
|
+
let isValid = spec.isBidRequestValid(PARAMS_MISSING_TS);
|
|
1809
1809
|
expect(isValid).to.equal(false);
|
|
1810
1810
|
});
|
|
1811
1811
|
});
|
|
1812
1812
|
|
|
1813
|
-
describe('interpretResponse
|
|
1813
|
+
describe('interpretResponse trustedstack', function () {
|
|
1814
1814
|
it('should not push response if no-bid', function () {
|
|
1815
1815
|
let validBids = [];
|
|
1816
1816
|
let bids = spec.interpretResponse(SERVER_RESPONSE_NOBID, []);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {expect} from 'chai';
|
|
2
2
|
import {spec} from 'modules/mediasquareBidAdapter.js';
|
|
3
|
+
import { server } from 'test/mocks/xhr.js';
|
|
3
4
|
|
|
4
5
|
describe('MediaSquare bid adapter tests', function () {
|
|
5
6
|
var DEFAULT_PARAMS = [{
|
|
@@ -208,6 +209,10 @@ describe('MediaSquare bid adapter tests', function () {
|
|
|
208
209
|
const response = spec.interpretResponse(BID_RESPONSE, request);
|
|
209
210
|
const won = spec.onBidWon(response[0]);
|
|
210
211
|
expect(won).to.equal(true);
|
|
212
|
+
expect(server.requests.length).to.equal(1);
|
|
213
|
+
let message = JSON.parse(server.requests[0].requestBody);
|
|
214
|
+
expect(message).to.have.property('increment').exist;
|
|
215
|
+
expect(message).to.have.property('increment').and.to.equal('1');
|
|
211
216
|
});
|
|
212
217
|
it('Verifies user sync without cookie in bid response', function () {
|
|
213
218
|
var syncs = spec.getUserSyncs({}, [BID_RESPONSE], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
|
|
@@ -112,7 +112,7 @@ describe('nativoBidAdapterTests', function () {
|
|
|
112
112
|
bidRequests = [JSON.parse(bidRequestString)]
|
|
113
113
|
})
|
|
114
114
|
|
|
115
|
-
it('
|
|
115
|
+
it('Request should be POST, with JSON string payload and QS params should be added to the url', function () {
|
|
116
116
|
const request = spec.buildRequests(bidRequests, {
|
|
117
117
|
bidderRequestId: 123456,
|
|
118
118
|
refererInfo: {
|
|
@@ -120,6 +120,11 @@ describe('nativoBidAdapterTests', function () {
|
|
|
120
120
|
},
|
|
121
121
|
})
|
|
122
122
|
|
|
123
|
+
expect(request.method).to.equal('POST')
|
|
124
|
+
|
|
125
|
+
expect(request.data).to.exist
|
|
126
|
+
expect(request.data).to.be.a('string')
|
|
127
|
+
|
|
123
128
|
expect(request.url).to.exist
|
|
124
129
|
expect(request.url).to.be.a('string')
|
|
125
130
|
|
|
@@ -312,6 +312,75 @@ describe('onetag', function () {
|
|
|
312
312
|
expect(payload.usPrivacy).to.exist;
|
|
313
313
|
expect(payload.usPrivacy).to.exist.and.to.equal(consentString);
|
|
314
314
|
});
|
|
315
|
+
it('Should send FPD (ortb2 field)', function () {
|
|
316
|
+
const firtPartyData = {
|
|
317
|
+
// this is where the contextual data is placed
|
|
318
|
+
site: {
|
|
319
|
+
name: 'example',
|
|
320
|
+
domain: 'page.example.com',
|
|
321
|
+
// OpenRTB 2.5 spec / Content Taxonomy
|
|
322
|
+
cat: ['IAB2'],
|
|
323
|
+
sectioncat: ['IAB2-2'],
|
|
324
|
+
pagecat: ['IAB2-2'],
|
|
325
|
+
page: 'https://page.example.com/here.html',
|
|
326
|
+
ref: 'https://ref.example.com',
|
|
327
|
+
keywords: 'power tools, drills',
|
|
328
|
+
search: 'drill',
|
|
329
|
+
content: {
|
|
330
|
+
userrating: '4',
|
|
331
|
+
data: [{
|
|
332
|
+
name: 'www.dataprovider1.com', // who resolved the segments
|
|
333
|
+
ext: {
|
|
334
|
+
segtax: 7, // taxonomy used to encode the segments
|
|
335
|
+
cids: ['iris_c73g5jq96mwso4d8']
|
|
336
|
+
},
|
|
337
|
+
// the bare minimum are the IDs. These IDs are the ones from the new IAB Content Taxonomy v3
|
|
338
|
+
segment: [ { id: '687' }, { id: '123' } ]
|
|
339
|
+
}]
|
|
340
|
+
},
|
|
341
|
+
ext: {
|
|
342
|
+
data: { // fields that aren't part of openrtb 2.6
|
|
343
|
+
pageType: 'article',
|
|
344
|
+
category: 'repair'
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
// this is where the user data is placed
|
|
349
|
+
user: {
|
|
350
|
+
keywords: 'a,b',
|
|
351
|
+
data: [{
|
|
352
|
+
name: 'dataprovider.com',
|
|
353
|
+
ext: {
|
|
354
|
+
segtax: 4
|
|
355
|
+
},
|
|
356
|
+
segment: [{
|
|
357
|
+
id: '1'
|
|
358
|
+
}]
|
|
359
|
+
}],
|
|
360
|
+
ext: {
|
|
361
|
+
data: {
|
|
362
|
+
registered: true,
|
|
363
|
+
interests: ['cars']
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
regs: {
|
|
368
|
+
gpp: 'abc1234',
|
|
369
|
+
gpp_sid: [7]
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
let bidderRequest = {
|
|
373
|
+
'bidderCode': 'onetag',
|
|
374
|
+
'auctionId': '1d1a030790a475',
|
|
375
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
376
|
+
'timeout': 3000,
|
|
377
|
+
'ortb2': firtPartyData
|
|
378
|
+
}
|
|
379
|
+
let serverRequest = spec.buildRequests([bannerBid], bidderRequest);
|
|
380
|
+
const payload = JSON.parse(serverRequest.data);
|
|
381
|
+
expect(payload.ortb2).to.exist;
|
|
382
|
+
expect(payload.ortb2).to.exist.and.to.deep.equal(firtPartyData);
|
|
383
|
+
});
|
|
315
384
|
});
|
|
316
385
|
describe('interpretResponse', function () {
|
|
317
386
|
const request = getBannerVideoRequest();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { operaIdSubmodule } from 'modules/operaadsIdSystem'
|
|
2
|
+
import * as ajaxLib from 'src/ajax.js'
|
|
3
|
+
|
|
4
|
+
const TEST_ID = 'opera-test-id';
|
|
5
|
+
const operaIdRemoteResponse = { uid: TEST_ID };
|
|
6
|
+
|
|
7
|
+
describe('operaId submodule properties', () => {
|
|
8
|
+
it('should expose a "name" property equal to "operaId"', () => {
|
|
9
|
+
expect(operaIdSubmodule.name).to.equal('operaId');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
function fakeRequest(fn) {
|
|
14
|
+
const ajaxBuilderStub = sinon.stub(ajaxLib, 'ajaxBuilder').callsFake(() => {
|
|
15
|
+
return (url, cbObj) => {
|
|
16
|
+
cbObj.success(JSON.stringify(operaIdRemoteResponse));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
fn();
|
|
20
|
+
ajaxBuilderStub.restore();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
describe('operaId submodule getId', function() {
|
|
24
|
+
it('request to the fake server to correctly extract test ID', function() {
|
|
25
|
+
fakeRequest(() => {
|
|
26
|
+
const moduleIdCallbackResponse = operaIdSubmodule.getId({ params: { pid: 'pub123' } });
|
|
27
|
+
moduleIdCallbackResponse.callback((id) => {
|
|
28
|
+
expect(id).to.equal(operaIdRemoteResponse.operaId);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('request to the fake server without publiser ID', function() {
|
|
34
|
+
fakeRequest(() => {
|
|
35
|
+
const moduleIdCallbackResponse = operaIdSubmodule.getId({ params: {} });
|
|
36
|
+
expect(moduleIdCallbackResponse).to.equal(undefined);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('operaId submodule decode', function() {
|
|
42
|
+
it('should respond with an object containing "operaId" as key with the value', () => {
|
|
43
|
+
expect(operaIdSubmodule.decode(TEST_ID)).to.deep.equal({
|
|
44
|
+
operaId: TEST_ID
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should respond with undefined if the value is not a string or an empty string', () => {
|
|
49
|
+
[1, 2.0, null, undefined, NaN, [], {}].forEach((value) => {
|
|
50
|
+
expect(operaIdSubmodule.decode(value)).to.equal(undefined);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { spec } from 'modules/optidigitalBidAdapter.js';
|
|
2
|
+
import { spec, resetSync } from 'modules/optidigitalBidAdapter.js';
|
|
3
3
|
import * as utils from 'src/utils.js';
|
|
4
4
|
|
|
5
5
|
const ENDPOINT = 'https://pbs.optidigital.com/bidder';
|
|
@@ -497,6 +497,7 @@ describe('optidigitalAdapterTests', function () {
|
|
|
497
497
|
let test;
|
|
498
498
|
beforeEach(function () {
|
|
499
499
|
test = sinon.sandbox.create();
|
|
500
|
+
resetSync();
|
|
500
501
|
});
|
|
501
502
|
afterEach(function() {
|
|
502
503
|
test.restore();
|
|
@@ -508,16 +509,22 @@ describe('optidigitalAdapterTests', function () {
|
|
|
508
509
|
}]);
|
|
509
510
|
});
|
|
510
511
|
|
|
511
|
-
it('should return appropriate URL', function() {
|
|
512
|
+
it('should return appropriate URL with GDPR equals to 1 and GDPR consent', function() {
|
|
512
513
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, undefined)).to.deep.equal([{
|
|
513
514
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo`
|
|
514
515
|
}]);
|
|
516
|
+
});
|
|
517
|
+
it('should return appropriate URL with GDPR equals to 0 and GDPR consent', function() {
|
|
515
518
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: false, consentString: 'foo'}, undefined)).to.deep.equal([{
|
|
516
519
|
type: 'iframe', url: `${syncurlIframe}&gdpr=0&gdpr_consent=foo`
|
|
517
520
|
}]);
|
|
521
|
+
});
|
|
522
|
+
it('should return appropriate URL with GDPR equals to 1 and no consent', function() {
|
|
518
523
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: undefined}, undefined)).to.deep.equal([{
|
|
519
524
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=`
|
|
520
525
|
}]);
|
|
526
|
+
});
|
|
527
|
+
it('should return appropriate URL with GDPR equals to 1, GDPR consent and CCPA consent', function() {
|
|
521
528
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, {consentString: 'fooUsp'})).to.deep.equal([{
|
|
522
529
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&ccpa_consent=fooUsp`
|
|
523
530
|
}]);
|