prebid.js 7.34.0 → 7.35.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/.devcontainer/devcontainer.json +2 -1
- package/.github/workflows/issue_tracker.yml +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.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/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hadronIdSystem.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/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +127 -137
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pulsepointBidAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smartytechBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/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/dist/zeta_global_sspBidAdapter.js +1 -1
- package/dist/zeusPrimeRtdProvider.js +4 -14
- package/integrationExamples/gpt/hello_world.html +0 -0
- package/modules/adyoulikeBidAdapter.js +2 -0
- package/modules/consentManagement.js +33 -5
- package/modules/cwireBidAdapter.js +169 -242
- package/modules/cwireBidAdapter.md +15 -14
- package/modules/hadronIdSystem.js +37 -32
- package/modules/nexx360BidAdapter.js +1 -2
- package/modules/onetagBidAdapter.js +12 -1
- package/modules/outbrainBidAdapter.js +103 -6
- package/modules/permutiveRtdProvider.js +17 -12
- package/modules/priceFloors.js +7 -8
- package/modules/pulsepointBidAdapter.js +2 -0
- package/modules/smartadserverBidAdapter.js +39 -28
- package/modules/smartyadsBidAdapter.md +9 -0
- package/modules/smartytechBidAdapter.js +67 -10
- package/modules/smartytechBidAdapter.md +44 -33
- package/modules/sonobiBidAdapter.js +17 -10
- package/modules/taboolaBidAdapter.js +2 -1
- package/modules/vidazooBidAdapter.js +56 -22
- package/modules/zeta_global_sspBidAdapter.js +15 -0
- package/modules/zeusPrimeRtdProvider.js +3 -323
- package/modules/zeusPrimeRtdProvider.md +3 -0
- package/package.json +1 -1
- package/src/auction.js +2 -11
- package/src/prebid.js +8 -0
- package/src/utils/cpm.js +17 -0
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +3 -0
- package/test/spec/modules/consentManagement_spec.js +49 -1
- package/test/spec/modules/cwireBidAdapter_spec.js +249 -335
- package/test/spec/modules/hadronIdSystem_spec.js +4 -6
- package/test/spec/modules/nexx360BidAdapter_spec.js +0 -4
- package/test/spec/modules/onetagBidAdapter_spec.js +43 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +182 -18
- package/test/spec/modules/pulsepointBidAdapter_spec.js +11 -1
- package/test/spec/modules/smartadserverBidAdapter_spec.js +116 -5
- package/test/spec/modules/smartytechBidAdapter_spec.js +172 -14
- package/test/spec/modules/sonobiBidAdapter_spec.js +2 -1
- package/test/spec/modules/taboolaBidAdapter_spec.js +12 -3
- package/test/spec/modules/userId_spec.js +19 -14
- package/test/spec/modules/vidazooBidAdapter_spec.js +61 -22
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +8 -0
- package/test/spec/unit/pbjs_api_spec.js +14 -0
- package/test/spec/unit/utils/cpm_spec.js +64 -0
- package/test/spec/modules/zeusPrimeRtdProvider_spec.js +0 -410
|
@@ -19,20 +19,116 @@ describe('SmartyTechDSPAdapter: inherited functions', function () {
|
|
|
19
19
|
|
|
20
20
|
describe('SmartyTechDSPAdapter: isBidRequestValid', function () {
|
|
21
21
|
it('Invalid bid request. Should return false', function () {
|
|
22
|
-
const
|
|
22
|
+
const bidFixture = {
|
|
23
23
|
params: {
|
|
24
24
|
use_id: 13144375
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.false
|
|
28
29
|
});
|
|
29
30
|
it('Valid bid request. Should return true', function () {
|
|
30
|
-
const
|
|
31
|
+
const bidFixture = {
|
|
31
32
|
params: {
|
|
32
33
|
endpointId: 13144375
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
expect(spec.isBidRequestValid(
|
|
36
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.true
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('Invalid bid request. Check video block', function () {
|
|
40
|
+
const bidFixture = {
|
|
41
|
+
params: {
|
|
42
|
+
endpointId: 1
|
|
43
|
+
},
|
|
44
|
+
mediaTypes: {
|
|
45
|
+
video: {}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.false
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('Invalid bid request. Check playerSize', function () {
|
|
52
|
+
const bidFixture = {
|
|
53
|
+
params: {
|
|
54
|
+
endpointId: 1
|
|
55
|
+
},
|
|
56
|
+
mediaTypes: {
|
|
57
|
+
video: {
|
|
58
|
+
playerSize: '300x250'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.false
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('Invalid bid request. Check context', function () {
|
|
66
|
+
const bidFixture = {
|
|
67
|
+
params: {
|
|
68
|
+
endpointId: 1
|
|
69
|
+
},
|
|
70
|
+
mediaTypes: {
|
|
71
|
+
video: {
|
|
72
|
+
playerSize: [300, 250]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.false
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('Valid bid request. valid video bid', function () {
|
|
80
|
+
const bidFixture = {
|
|
81
|
+
params: {
|
|
82
|
+
endpointId: 1
|
|
83
|
+
},
|
|
84
|
+
mediaTypes: {
|
|
85
|
+
video: {
|
|
86
|
+
playerSize: [300, 250],
|
|
87
|
+
context: 'instream'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.true
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('Invalid bid request. Check banner block', function () {
|
|
95
|
+
const bidFixture = {
|
|
96
|
+
params: {
|
|
97
|
+
endpointId: 1
|
|
98
|
+
},
|
|
99
|
+
mediaTypes: {
|
|
100
|
+
banner: {}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.false
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('Invalid bid request. Check banner sizes', function () {
|
|
107
|
+
const bidFixture = {
|
|
108
|
+
params: {
|
|
109
|
+
endpointId: 1
|
|
110
|
+
},
|
|
111
|
+
mediaTypes: {
|
|
112
|
+
banner: {
|
|
113
|
+
sizes: '300x250'
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.false
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('Valid bid request. valid banner bid', function () {
|
|
121
|
+
const bidFixture = {
|
|
122
|
+
params: {
|
|
123
|
+
endpointId: 1
|
|
124
|
+
},
|
|
125
|
+
mediaTypes: {
|
|
126
|
+
banner: {
|
|
127
|
+
sizes: [[300, 250]]
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
expect(spec.isBidRequestValid(bidFixture)).to.be.true
|
|
36
132
|
});
|
|
37
133
|
});
|
|
38
134
|
|
|
@@ -42,12 +138,29 @@ function mockRandomSizeArray(len) {
|
|
|
42
138
|
});
|
|
43
139
|
}
|
|
44
140
|
|
|
45
|
-
function mockBidRequestListData(size) {
|
|
141
|
+
function mockBidRequestListData(mediaType, size) {
|
|
46
142
|
return Array.apply(null, {length: size}).map((i, index) => {
|
|
47
143
|
const id = Math.floor(Math.random() * 800) * (index + 1);
|
|
144
|
+
let mediaTypes;
|
|
145
|
+
|
|
146
|
+
if (mediaType == 'video') {
|
|
147
|
+
mediaTypes = {
|
|
148
|
+
video: {
|
|
149
|
+
playerSize: mockRandomSizeArray(1),
|
|
150
|
+
context: 'instream'
|
|
151
|
+
},
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
mediaTypes = {
|
|
155
|
+
banner: {
|
|
156
|
+
sizes: mockRandomSizeArray(index + 1)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
48
161
|
return {
|
|
49
162
|
adUnitCode: `adUnitCode-${id}`,
|
|
50
|
-
|
|
163
|
+
mediaTypes: mediaTypes,
|
|
51
164
|
bidId: `bidId-${id}`,
|
|
52
165
|
params: {
|
|
53
166
|
endpointId: id
|
|
@@ -66,18 +179,27 @@ function mockRefererData() {
|
|
|
66
179
|
|
|
67
180
|
function mockResponseData(requestData) {
|
|
68
181
|
let data = {}
|
|
69
|
-
|
|
70
182
|
requestData.data.forEach((request, index) => {
|
|
71
|
-
const sizeArrayIndex = Math.floor(Math.random() * (request.sizes.length - 1));
|
|
72
183
|
const rndIndex = Math.floor(Math.random() * 800);
|
|
184
|
+
let width, height, mediaType;
|
|
185
|
+
if (request.video !== undefined) {
|
|
186
|
+
width = request.video.playerSize[0][0];
|
|
187
|
+
height = request.video.playerSize[0][1];
|
|
188
|
+
mediaType = 'video';
|
|
189
|
+
} else {
|
|
190
|
+
width = request.banner.sizes[0][0];
|
|
191
|
+
height = request.banner.sizes[0][1];
|
|
192
|
+
mediaType = 'banner';
|
|
193
|
+
}
|
|
73
194
|
|
|
74
195
|
data[request.adUnitCode] = {
|
|
75
196
|
ad: `ad-${rndIndex}`,
|
|
76
|
-
width:
|
|
77
|
-
height:
|
|
197
|
+
width: width,
|
|
198
|
+
height: height,
|
|
78
199
|
creativeId: `creative-id-${index}`,
|
|
79
200
|
cpm: Math.floor(Math.random() * 100),
|
|
80
|
-
currency: `UAH-${rndIndex}
|
|
201
|
+
currency: `UAH-${rndIndex}`,
|
|
202
|
+
mediaType: mediaType
|
|
81
203
|
};
|
|
82
204
|
});
|
|
83
205
|
return {
|
|
@@ -89,7 +211,7 @@ describe('SmartyTechDSPAdapter: buildRequests', () => {
|
|
|
89
211
|
let mockBidRequest;
|
|
90
212
|
let mockReferer;
|
|
91
213
|
beforeEach(() => {
|
|
92
|
-
mockBidRequest = mockBidRequestListData(8);
|
|
214
|
+
mockBidRequest = mockBidRequestListData('banner', 8);
|
|
93
215
|
mockReferer = mockRefererData();
|
|
94
216
|
});
|
|
95
217
|
it('has return data', () => {
|
|
@@ -108,7 +230,7 @@ describe('SmartyTechDSPAdapter: buildRequests', () => {
|
|
|
108
230
|
const data = spec.buildRequests(mockBidRequest, mockReferer).data;
|
|
109
231
|
data.forEach((request, index) => {
|
|
110
232
|
expect(request.adUnitCode).to.be.equal(mockBidRequest[index].adUnitCode);
|
|
111
|
-
expect(request.
|
|
233
|
+
expect(request.banner).to.be.equal(mockBidRequest[index].mediaTypes.banner);
|
|
112
234
|
expect(request.bidId).to.be.equal(mockBidRequest[index].bidId);
|
|
113
235
|
expect(request.endpointId).to.be.equal(mockBidRequest[index].params.endpointId);
|
|
114
236
|
expect(request.referer).to.be.equal(mockReferer.refererInfo.page);
|
|
@@ -122,7 +244,7 @@ describe('SmartyTechDSPAdapter: interpretResponse', () => {
|
|
|
122
244
|
let request;
|
|
123
245
|
let mockResponse;
|
|
124
246
|
beforeEach(() => {
|
|
125
|
-
const brData = mockBidRequestListData(2);
|
|
247
|
+
const brData = mockBidRequestListData('banner', 2);
|
|
126
248
|
mockReferer = mockRefererData();
|
|
127
249
|
request = spec.buildRequests(brData, mockReferer);
|
|
128
250
|
mockBidRequest = {
|
|
@@ -157,6 +279,42 @@ describe('SmartyTechDSPAdapter: interpretResponse', () => {
|
|
|
157
279
|
expect(responseItem.requestId).to.be.equal(mockBidRequest.data[index].bidId);
|
|
158
280
|
expect(responseItem.width).to.be.equal(mockResponse.body[keys[index]].width);
|
|
159
281
|
expect(responseItem.height).to.be.equal(mockResponse.body[keys[index]].height);
|
|
282
|
+
expect(responseItem.mediaType).to.be.equal(mockResponse.body[keys[index]].mediaType);
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
describe('SmartyTechDSPAdapter: interpretResponse video', () => {
|
|
288
|
+
let mockBidRequest;
|
|
289
|
+
let mockReferer;
|
|
290
|
+
let request;
|
|
291
|
+
let mockResponse;
|
|
292
|
+
beforeEach(() => {
|
|
293
|
+
const brData = mockBidRequestListData('video', 2);
|
|
294
|
+
mockReferer = mockRefererData();
|
|
295
|
+
request = spec.buildRequests(brData, mockReferer);
|
|
296
|
+
mockBidRequest = {
|
|
297
|
+
data: brData
|
|
298
|
+
}
|
|
299
|
+
mockResponse = mockResponseData(request);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it('interpretResponse: convert to correct data', () => {
|
|
303
|
+
const keys = Object.keys(mockResponse.body);
|
|
304
|
+
const data = spec.interpretResponse(mockResponse, mockBidRequest);
|
|
305
|
+
|
|
306
|
+
data.forEach((responseItem, index) => {
|
|
307
|
+
expect(responseItem.ad).to.be.equal(mockResponse.body[keys[index]].ad);
|
|
308
|
+
expect(responseItem.cpm).to.be.equal(mockResponse.body[keys[index]].cpm);
|
|
309
|
+
expect(responseItem.creativeId).to.be.equal(mockResponse.body[keys[index]].creativeId);
|
|
310
|
+
expect(responseItem.currency).to.be.equal(mockResponse.body[keys[index]].currency);
|
|
311
|
+
expect(responseItem.netRevenue).to.be.true;
|
|
312
|
+
expect(responseItem.ttl).to.be.equal(60);
|
|
313
|
+
expect(responseItem.requestId).to.be.equal(mockBidRequest.data[index].bidId);
|
|
314
|
+
expect(responseItem.width).to.be.equal(mockResponse.body[keys[index]].width);
|
|
315
|
+
expect(responseItem.height).to.be.equal(mockResponse.body[keys[index]].height);
|
|
316
|
+
expect(responseItem.mediaType).to.be.equal(mockResponse.body[keys[index]].mediaType);
|
|
317
|
+
expect(responseItem.vastXml).to.be.equal(mockResponse.body[keys[index]].ad);
|
|
160
318
|
});
|
|
161
319
|
});
|
|
162
320
|
});
|
|
@@ -287,6 +287,7 @@ describe('SonobiBidAdapter', function () {
|
|
|
287
287
|
},
|
|
288
288
|
mediaTypes: {
|
|
289
289
|
video: {
|
|
290
|
+
sizes: [[300, 250], [300, 600]],
|
|
290
291
|
context: 'outstream'
|
|
291
292
|
}
|
|
292
293
|
}
|
|
@@ -331,7 +332,7 @@ describe('SonobiBidAdapter', function () {
|
|
|
331
332
|
}];
|
|
332
333
|
|
|
333
334
|
let keyMakerData = {
|
|
334
|
-
'30b31c1838de1f': '1a2b3c4d5e6f1a2b3c4d
|
|
335
|
+
'30b31c1838de1f': '1a2b3c4d5e6f1a2b3c4d|300x250,300x600|f=1.25,gpid=/123123/gpt_publisher/adunit-code-1,c=v,',
|
|
335
336
|
'30b31c1838de1d': '1a2b3c4d5e6f1a2b3c4e|300x250,300x600|f=0.42,gpid=/123123/gpt_publisher/adunit-code-3,c=d,',
|
|
336
337
|
'/7780971/sparks_prebid_LB|30b31c1838de1e': '300x250,300x600|gpid=/7780971/sparks_prebid_LB,c=d,',
|
|
337
338
|
};
|
|
@@ -460,7 +460,9 @@ describe('Taboola Adapter', function () {
|
|
|
460
460
|
'w': 300,
|
|
461
461
|
'h': 250,
|
|
462
462
|
'exp': 60,
|
|
463
|
-
'lurl': 'http://us-trc.taboola.com/sample'
|
|
463
|
+
'lurl': 'http://us-trc.taboola.com/sample',
|
|
464
|
+
'nurl': 'http://win.example.com/',
|
|
465
|
+
|
|
464
466
|
}
|
|
465
467
|
],
|
|
466
468
|
'seat': '14204545260'
|
|
@@ -546,7 +548,8 @@ describe('Taboola Adapter', function () {
|
|
|
546
548
|
'w': 300,
|
|
547
549
|
'h': 250,
|
|
548
550
|
'exp': 60,
|
|
549
|
-
'lurl': 'http://us-trc.taboola.com/sample'
|
|
551
|
+
'lurl': 'http://us-trc.taboola.com/sample',
|
|
552
|
+
'nurl': 'http://win.example.com/'
|
|
550
553
|
},
|
|
551
554
|
{
|
|
552
555
|
'id': '0b3dd94348-134b-435f-8db5-6bf5afgfc39e86c',
|
|
@@ -562,7 +565,9 @@ describe('Taboola Adapter', function () {
|
|
|
562
565
|
'w': 300,
|
|
563
566
|
'h': 250,
|
|
564
567
|
'exp': 60,
|
|
565
|
-
'lurl': 'http://us-trc.taboola.com/sample'
|
|
568
|
+
'lurl': 'http://us-trc.taboola.com/sample',
|
|
569
|
+
'nurl': 'http://win.example.com/'
|
|
570
|
+
|
|
566
571
|
}
|
|
567
572
|
],
|
|
568
573
|
'seat': '14204545260'
|
|
@@ -586,6 +591,7 @@ describe('Taboola Adapter', function () {
|
|
|
586
591
|
ad: multiServerResponse.body.seatbid[0].bid[0].adm,
|
|
587
592
|
width: bid.w,
|
|
588
593
|
height: bid.h,
|
|
594
|
+
nurl: 'http://win.example.com/',
|
|
589
595
|
meta: {
|
|
590
596
|
'advertiserDomains': bid.adomain
|
|
591
597
|
},
|
|
@@ -601,6 +607,7 @@ describe('Taboola Adapter', function () {
|
|
|
601
607
|
ad: multiServerResponse.body.seatbid[0].bid[1].adm,
|
|
602
608
|
width: bid.w,
|
|
603
609
|
height: bid.h,
|
|
610
|
+
nurl: 'http://win.example.com/',
|
|
604
611
|
meta: {
|
|
605
612
|
'advertiserDomains': bid.adomain
|
|
606
613
|
},
|
|
@@ -625,6 +632,7 @@ describe('Taboola Adapter', function () {
|
|
|
625
632
|
ad: bid.adm,
|
|
626
633
|
width: bid.w,
|
|
627
634
|
height: bid.h,
|
|
635
|
+
nurl: 'http://win.example.com/',
|
|
628
636
|
meta: {
|
|
629
637
|
'advertiserDomains': bid.adomain
|
|
630
638
|
},
|
|
@@ -651,6 +659,7 @@ describe('Taboola Adapter', function () {
|
|
|
651
659
|
ad: bid.adm,
|
|
652
660
|
width: bid.w,
|
|
653
661
|
height: bid.h,
|
|
662
|
+
nurl: 'http://win.example.com/',
|
|
654
663
|
meta: {
|
|
655
664
|
'advertiserDomains': bid.adomain
|
|
656
665
|
},
|
|
@@ -897,7 +897,7 @@ describe('User ID', function () {
|
|
|
897
897
|
storage: {name: 'intentIqId', type: 'cookie'}
|
|
898
898
|
}, {
|
|
899
899
|
name: 'hadronId',
|
|
900
|
-
storage: {name: 'hadronId', type: '
|
|
900
|
+
storage: {name: 'hadronId', type: 'html5'}
|
|
901
901
|
}, {
|
|
902
902
|
name: 'zeotapIdPlus'
|
|
903
903
|
}, {
|
|
@@ -1872,8 +1872,8 @@ describe('User ID', function () {
|
|
|
1872
1872
|
|
|
1873
1873
|
it('test hook from hadronId html5', function (done) {
|
|
1874
1874
|
// simulate existing browser local storage values
|
|
1875
|
-
localStorage.setItem('hadronId', JSON.stringify({'hadronId': '
|
|
1876
|
-
localStorage.setItem('hadronId_exp',
|
|
1875
|
+
localStorage.setItem('hadronId', JSON.stringify({'hadronId': 'testHadronId1'}));
|
|
1876
|
+
localStorage.setItem('hadronId_exp', (new Date(Date.now() + 5000)).toUTCString());
|
|
1877
1877
|
|
|
1878
1878
|
init(config);
|
|
1879
1879
|
setSubmoduleRegistry([hadronIdSubmodule]);
|
|
@@ -1883,15 +1883,15 @@ describe('User ID', function () {
|
|
|
1883
1883
|
adUnits.forEach(unit => {
|
|
1884
1884
|
unit.bids.forEach(bid => {
|
|
1885
1885
|
expect(bid).to.have.deep.nested.property('userId.hadronId');
|
|
1886
|
-
expect(bid.userId.hadronId).to.equal('
|
|
1886
|
+
expect(bid.userId.hadronId).to.equal('testHadronId1');
|
|
1887
1887
|
expect(bid.userIdAsEids[0]).to.deep.equal({
|
|
1888
1888
|
source: 'audigent.com',
|
|
1889
|
-
uids: [{id: '
|
|
1889
|
+
uids: [{id: 'testHadronId1', atype: 1}]
|
|
1890
1890
|
});
|
|
1891
1891
|
});
|
|
1892
1892
|
});
|
|
1893
1893
|
localStorage.removeItem('hadronId');
|
|
1894
|
-
localStorage.removeItem('hadronId_exp'
|
|
1894
|
+
localStorage.removeItem('hadronId_exp');
|
|
1895
1895
|
done();
|
|
1896
1896
|
}, {adUnits});
|
|
1897
1897
|
});
|
|
@@ -2125,7 +2125,9 @@ describe('User ID', function () {
|
|
|
2125
2125
|
coreStorage.setCookie('netId', JSON.stringify({'netId': 'testnetId'}), (new Date(Date.now() + 5000).toUTCString()));
|
|
2126
2126
|
coreStorage.setCookie('intentIqId', 'testintentIqId', (new Date(Date.now() + 5000).toUTCString()));
|
|
2127
2127
|
coreStorage.setCookie('IDP', btoa(JSON.stringify('zeotapId')), (new Date(Date.now() + 5000).toUTCString()));
|
|
2128
|
-
|
|
2128
|
+
// hadronId only supports localStorage
|
|
2129
|
+
localStorage.setItem('hadronId', JSON.stringify({'hadronId': 'testHadronId1'}));
|
|
2130
|
+
localStorage.setItem('hadronId_exp', (new Date(Date.now() + 5000)).toUTCString());
|
|
2129
2131
|
coreStorage.setCookie('storage_criteo', JSON.stringify({'criteoId': 'test_bidid'}), (new Date(Date.now() + 5000).toUTCString()));
|
|
2130
2132
|
coreStorage.setCookie('mwol', JSON.stringify({eid: 'XX-YY-ZZ-123'}), (new Date(Date.now() + 5000).toUTCString()));
|
|
2131
2133
|
coreStorage.setCookie('uid2id', 'Sample_AD_Token', (new Date(Date.now() + 5000).toUTCString()));
|
|
@@ -2149,7 +2151,7 @@ describe('User ID', function () {
|
|
|
2149
2151
|
['netId', 'netId', 'cookie'],
|
|
2150
2152
|
['intentIqId', 'intentIqId', 'cookie'],
|
|
2151
2153
|
['zeotapIdPlus', 'IDP', 'cookie'],
|
|
2152
|
-
['hadronId', 'hadronId', '
|
|
2154
|
+
['hadronId', 'hadronId', 'html5'],
|
|
2153
2155
|
['criteo', 'storage_criteo', 'cookie'],
|
|
2154
2156
|
['mwOpenLinkId', 'mwol', 'cookie'],
|
|
2155
2157
|
['tapadId', 'tapad_id', 'cookie'],
|
|
@@ -2192,7 +2194,7 @@ describe('User ID', function () {
|
|
|
2192
2194
|
expect(bid.userId.IDP).to.equal('zeotapId');
|
|
2193
2195
|
// also check that hadronId id was copied to bid
|
|
2194
2196
|
expect(bid).to.have.deep.nested.property('userId.hadronId');
|
|
2195
|
-
expect(bid.userId.hadronId).to.equal('
|
|
2197
|
+
expect(bid.userId.hadronId).to.equal('testHadronId1');
|
|
2196
2198
|
// also check that criteo id was copied to bid
|
|
2197
2199
|
expect(bid).to.have.deep.nested.property('userId.criteoId');
|
|
2198
2200
|
expect(bid.userId.criteoId).to.equal('test_bidid');
|
|
@@ -2231,7 +2233,8 @@ describe('User ID', function () {
|
|
|
2231
2233
|
coreStorage.setCookie('netId', '', EXPIRED_COOKIE_DATE);
|
|
2232
2234
|
coreStorage.setCookie('intentIqId', '', EXPIRED_COOKIE_DATE);
|
|
2233
2235
|
coreStorage.setCookie('IDP', '', EXPIRED_COOKIE_DATE);
|
|
2234
|
-
|
|
2236
|
+
localStorage.removeItem('hadronId');
|
|
2237
|
+
localStorage.removeItem('hadronId_exp');
|
|
2235
2238
|
coreStorage.setCookie('storage_criteo', '', EXPIRED_COOKIE_DATE);
|
|
2236
2239
|
coreStorage.setCookie('mwol', '', EXPIRED_COOKIE_DATE);
|
|
2237
2240
|
coreStorage.setCookie('uid2id', '', EXPIRED_COOKIE_DATE);
|
|
@@ -2284,7 +2287,8 @@ describe('User ID', function () {
|
|
|
2284
2287
|
coreStorage.setCookie('netId', JSON.stringify({'netId': 'testnetId'}), new Date(Date.now() + 5000).toUTCString());
|
|
2285
2288
|
coreStorage.setCookie('intentIqId', 'testintentIqId', (new Date(Date.now() + 5000).toUTCString()));
|
|
2286
2289
|
coreStorage.setCookie('IDP', btoa(JSON.stringify('zeotapId')), (new Date(Date.now() + 5000).toUTCString()));
|
|
2287
|
-
|
|
2290
|
+
localStorage.setItem('hadronId', JSON.stringify({'hadronId': 'testHadronId1'}));
|
|
2291
|
+
localStorage.setItem('hadronId_exp', (new Date(Date.now() + 5000)).toUTCString());
|
|
2288
2292
|
coreStorage.setCookie('admixerId', 'testadmixerId', new Date(Date.now() + 5000).toUTCString());
|
|
2289
2293
|
coreStorage.setCookie('deepintentId', 'testdeepintentId', new Date(Date.now() + 5000).toUTCString());
|
|
2290
2294
|
coreStorage.setCookie('MOCKID', JSON.stringify({'MOCKID': '123456778'}), new Date(Date.now() + 5000).toUTCString());
|
|
@@ -2320,7 +2324,7 @@ describe('User ID', function () {
|
|
|
2320
2324
|
}, {
|
|
2321
2325
|
name: 'zeotapIdPlus'
|
|
2322
2326
|
}, {
|
|
2323
|
-
name: 'hadronId', storage: {name: 'hadronId', type: '
|
|
2327
|
+
name: 'hadronId', storage: {name: 'hadronId', type: 'html5'}
|
|
2324
2328
|
}, {
|
|
2325
2329
|
name: 'admixerId', storage: {name: 'admixerId', type: 'cookie'}
|
|
2326
2330
|
}, {
|
|
@@ -2388,7 +2392,7 @@ describe('User ID', function () {
|
|
|
2388
2392
|
expect(bid.userId.IDP).to.equal('zeotapId');
|
|
2389
2393
|
// also check that hadronId id data was copied to bid
|
|
2390
2394
|
expect(bid).to.have.deep.nested.property('userId.hadronId');
|
|
2391
|
-
expect(bid.userId.hadronId).to.equal('
|
|
2395
|
+
expect(bid.userId.hadronId).to.equal('testHadronId1');
|
|
2392
2396
|
expect(bid.userId.uid2).to.deep.equal({
|
|
2393
2397
|
id: 'Sample_AD_Token'
|
|
2394
2398
|
});
|
|
@@ -2420,7 +2424,8 @@ describe('User ID', function () {
|
|
|
2420
2424
|
coreStorage.setCookie('netId', '', EXPIRED_COOKIE_DATE);
|
|
2421
2425
|
coreStorage.setCookie('intentIqId', '', EXPIRED_COOKIE_DATE);
|
|
2422
2426
|
coreStorage.setCookie('IDP', '', EXPIRED_COOKIE_DATE);
|
|
2423
|
-
|
|
2427
|
+
localStorage.removeItem('hadronId');
|
|
2428
|
+
localStorage.removeItem('hadronId_exp');
|
|
2424
2429
|
coreStorage.setCookie('dmdId', '', EXPIRED_COOKIE_DATE);
|
|
2425
2430
|
coreStorage.setCookie('admixerId', '', EXPIRED_COOKIE_DATE);
|
|
2426
2431
|
coreStorage.setCookie('deepintentId', '', EXPIRED_COOKIE_DATE);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {expect} from 'chai';
|
|
2
2
|
import {
|
|
3
3
|
spec as adapter,
|
|
4
4
|
SUPPORTED_ID_SYSTEMS,
|
|
@@ -15,9 +15,10 @@ import {
|
|
|
15
15
|
getVidazooSessionId,
|
|
16
16
|
} from 'modules/vidazooBidAdapter.js';
|
|
17
17
|
import * as utils from 'src/utils.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import {version} from 'package.json';
|
|
19
|
+
import {useFakeTimers} from 'sinon';
|
|
20
|
+
import {BANNER, VIDEO} from '../../../src/mediaTypes';
|
|
21
|
+
import {config} from '../../../src/config';
|
|
21
22
|
|
|
22
23
|
const SUB_DOMAIN = 'openrtb';
|
|
23
24
|
|
|
@@ -38,6 +39,10 @@ const BID = {
|
|
|
38
39
|
'transactionId': 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
|
|
39
40
|
'sizes': [[300, 250], [300, 600]],
|
|
40
41
|
'bidderRequestId': '1fdb5ff1b6eaa7',
|
|
42
|
+
'auctionId': 'auction_id',
|
|
43
|
+
'bidRequestsCount': 4,
|
|
44
|
+
'bidderRequestsCount': 3,
|
|
45
|
+
'bidderWinsCount': 1,
|
|
41
46
|
'requestId': 'b0777d85-d061-450e-9bc7-260dd54bbb7a',
|
|
42
47
|
'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
|
|
43
48
|
'mediaTypes': [BANNER],
|
|
@@ -53,6 +58,10 @@ const VIDEO_BID = {
|
|
|
53
58
|
'adUnitCode': '63550ad1ff6642d368cba59dh5884270560',
|
|
54
59
|
'bidderRequestId': '12a8ae9ada9c13',
|
|
55
60
|
'transactionId': '56e184c6-bde9-497b-b9b9-cf47a61381ee',
|
|
61
|
+
'auctionId': 'auction_id',
|
|
62
|
+
'bidRequestsCount': 4,
|
|
63
|
+
'bidderRequestsCount': 3,
|
|
64
|
+
'bidderWinsCount': 1,
|
|
56
65
|
'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
|
|
57
66
|
'params': {
|
|
58
67
|
'subDomain': SUB_DOMAIN,
|
|
@@ -85,6 +94,8 @@ const BIDDER_REQUEST = {
|
|
|
85
94
|
'consentString': 'consent_string',
|
|
86
95
|
'gdprApplies': true
|
|
87
96
|
},
|
|
97
|
+
'gppString': 'gpp_string',
|
|
98
|
+
'gppSid': [7],
|
|
88
99
|
'uspConsent': 'consent_string',
|
|
89
100
|
'refererInfo': {
|
|
90
101
|
'page': 'https://www.greatsite.com',
|
|
@@ -94,6 +105,10 @@ const BIDDER_REQUEST = {
|
|
|
94
105
|
'site': {
|
|
95
106
|
'cat': ['IAB2'],
|
|
96
107
|
'pagecat': ['IAB2-2']
|
|
108
|
+
},
|
|
109
|
+
'regs': {
|
|
110
|
+
'gpp': 'gpp_string',
|
|
111
|
+
'gpp_sid': [7]
|
|
97
112
|
}
|
|
98
113
|
},
|
|
99
114
|
};
|
|
@@ -147,7 +162,7 @@ const REQUEST = {
|
|
|
147
162
|
|
|
148
163
|
function getTopWindowQueryParams() {
|
|
149
164
|
try {
|
|
150
|
-
const parsedUrl = utils.parseUrl(window.top.document.URL, {
|
|
165
|
+
const parsedUrl = utils.parseUrl(window.top.document.URL, {decodeSearchAsString: true});
|
|
151
166
|
return parsedUrl.search;
|
|
152
167
|
} catch (e) {
|
|
153
168
|
return '';
|
|
@@ -226,6 +241,9 @@ describe('VidazooBidAdapter', function () {
|
|
|
226
241
|
|
|
227
242
|
it('should build video request', function () {
|
|
228
243
|
const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
|
|
244
|
+
config.setConfig({
|
|
245
|
+
bidderTimeout: 3000
|
|
246
|
+
});
|
|
229
247
|
const requests = adapter.buildRequests([VIDEO_BID], BIDDER_REQUEST);
|
|
230
248
|
expect(requests).to.have.length(1);
|
|
231
249
|
expect(requests[0]).to.deep.equal({
|
|
@@ -243,6 +261,15 @@ describe('VidazooBidAdapter', function () {
|
|
|
243
261
|
gdpr: 1,
|
|
244
262
|
gdprConsent: 'consent_string',
|
|
245
263
|
usPrivacy: 'consent_string',
|
|
264
|
+
gppString: 'gpp_string',
|
|
265
|
+
gppSid: [7],
|
|
266
|
+
auctionId: 'auction_id',
|
|
267
|
+
bidRequestsCount: 4,
|
|
268
|
+
bidderRequestsCount: 3,
|
|
269
|
+
bidderWinsCount: 1,
|
|
270
|
+
bidderTimeout: 3000,
|
|
271
|
+
transactionId: '56e184c6-bde9-497b-b9b9-cf47a61381ee',
|
|
272
|
+
bidderRequestId: '12a8ae9ada9c13',
|
|
246
273
|
gpid: '',
|
|
247
274
|
prebidVersion: version,
|
|
248
275
|
ptrace: '1000',
|
|
@@ -278,6 +305,9 @@ describe('VidazooBidAdapter', function () {
|
|
|
278
305
|
});
|
|
279
306
|
|
|
280
307
|
it('should build banner request for each size', function () {
|
|
308
|
+
config.setConfig({
|
|
309
|
+
bidderTimeout: 3000
|
|
310
|
+
});
|
|
281
311
|
const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
|
|
282
312
|
const requests = adapter.buildRequests([BID], BIDDER_REQUEST);
|
|
283
313
|
expect(requests).to.have.length(1);
|
|
@@ -288,6 +318,15 @@ describe('VidazooBidAdapter', function () {
|
|
|
288
318
|
gdprConsent: 'consent_string',
|
|
289
319
|
gdpr: 1,
|
|
290
320
|
usPrivacy: 'consent_string',
|
|
321
|
+
gppString: 'gpp_string',
|
|
322
|
+
gppSid: [7],
|
|
323
|
+
auctionId: 'auction_id',
|
|
324
|
+
bidRequestsCount: 4,
|
|
325
|
+
bidderRequestsCount: 3,
|
|
326
|
+
bidderWinsCount: 1,
|
|
327
|
+
bidderTimeout: 3000,
|
|
328
|
+
transactionId: 'c881914b-a3b5-4ecf-ad9c-1c2f37c6aabf',
|
|
329
|
+
bidderRequestId: '1fdb5ff1b6eaa7',
|
|
291
330
|
sizes: ['300x250', '300x600'],
|
|
292
331
|
url: 'https%3A%2F%2Fwww.greatsite.com',
|
|
293
332
|
referrer: 'https://www.somereferrer.com',
|
|
@@ -324,7 +363,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
324
363
|
|
|
325
364
|
describe('getUserSyncs', function () {
|
|
326
365
|
it('should have valid user sync with iframeEnabled', function () {
|
|
327
|
-
const result = adapter.getUserSyncs({
|
|
366
|
+
const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
|
|
328
367
|
|
|
329
368
|
expect(result).to.deep.equal([{
|
|
330
369
|
type: 'iframe',
|
|
@@ -333,7 +372,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
333
372
|
});
|
|
334
373
|
|
|
335
374
|
it('should have valid user sync with cid on response', function () {
|
|
336
|
-
const result = adapter.getUserSyncs({
|
|
375
|
+
const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
|
|
337
376
|
expect(result).to.deep.equal([{
|
|
338
377
|
type: 'iframe',
|
|
339
378
|
url: 'https://sync.cootlogix.com/api/sync/iframe/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy='
|
|
@@ -341,7 +380,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
341
380
|
});
|
|
342
381
|
|
|
343
382
|
it('should have valid user sync with pixelEnabled', function () {
|
|
344
|
-
const result = adapter.getUserSyncs({
|
|
383
|
+
const result = adapter.getUserSyncs({pixelEnabled: true}, [SERVER_RESPONSE]);
|
|
345
384
|
|
|
346
385
|
expect(result).to.deep.equal([{
|
|
347
386
|
'url': 'https://sync.cootlogix.com/api/sync/image/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy=',
|
|
@@ -357,12 +396,12 @@ describe('VidazooBidAdapter', function () {
|
|
|
357
396
|
});
|
|
358
397
|
|
|
359
398
|
it('should return empty array when there is no ad', function () {
|
|
360
|
-
const responses = adapter.interpretResponse({
|
|
399
|
+
const responses = adapter.interpretResponse({price: 1, ad: ''});
|
|
361
400
|
expect(responses).to.be.empty;
|
|
362
401
|
});
|
|
363
402
|
|
|
364
403
|
it('should return empty array when there is no price', function () {
|
|
365
|
-
const responses = adapter.interpretResponse({
|
|
404
|
+
const responses = adapter.interpretResponse({price: null, ad: 'great ad'});
|
|
366
405
|
expect(responses).to.be.empty;
|
|
367
406
|
});
|
|
368
407
|
|
|
@@ -422,11 +461,11 @@ describe('VidazooBidAdapter', function () {
|
|
|
422
461
|
const userId = (function () {
|
|
423
462
|
switch (idSystemProvider) {
|
|
424
463
|
case 'lipb':
|
|
425
|
-
return {
|
|
464
|
+
return {lipbid: id};
|
|
426
465
|
case 'parrableId':
|
|
427
|
-
return {
|
|
466
|
+
return {eid: id};
|
|
428
467
|
case 'id5id':
|
|
429
|
-
return {
|
|
468
|
+
return {uid: id};
|
|
430
469
|
default:
|
|
431
470
|
return id;
|
|
432
471
|
}
|
|
@@ -445,18 +484,18 @@ describe('VidazooBidAdapter', function () {
|
|
|
445
484
|
|
|
446
485
|
describe('alternate param names extractors', function () {
|
|
447
486
|
it('should return undefined when param not supported', function () {
|
|
448
|
-
const cid = extractCID({
|
|
449
|
-
const pid = extractPID({
|
|
450
|
-
const subDomain = extractSubDomain({
|
|
487
|
+
const cid = extractCID({'c_id': '1'});
|
|
488
|
+
const pid = extractPID({'p_id': '1'});
|
|
489
|
+
const subDomain = extractSubDomain({'sub_domain': 'prebid'});
|
|
451
490
|
expect(cid).to.be.undefined;
|
|
452
491
|
expect(pid).to.be.undefined;
|
|
453
492
|
expect(subDomain).to.be.undefined;
|
|
454
493
|
});
|
|
455
494
|
|
|
456
495
|
it('should return value when param supported', function () {
|
|
457
|
-
const cid = extractCID({
|
|
458
|
-
const pid = extractPID({
|
|
459
|
-
const subDomain = extractSubDomain({
|
|
496
|
+
const cid = extractCID({'cID': '1'});
|
|
497
|
+
const pid = extractPID({'Pid': '2'});
|
|
498
|
+
const subDomain = extractSubDomain({'subDOMAIN': 'prebid'});
|
|
460
499
|
expect(cid).to.be.equal('1');
|
|
461
500
|
expect(pid).to.be.equal('2');
|
|
462
501
|
expect(subDomain).to.be.equal('prebid');
|
|
@@ -569,7 +608,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
569
608
|
now
|
|
570
609
|
});
|
|
571
610
|
setStorageItem('myKey', 2020);
|
|
572
|
-
const {
|
|
611
|
+
const {value, created} = getStorageItem('myKey');
|
|
573
612
|
expect(created).to.be.equal(now);
|
|
574
613
|
expect(value).to.be.equal(2020);
|
|
575
614
|
expect(typeof value).to.be.equal('number');
|
|
@@ -585,8 +624,8 @@ describe('VidazooBidAdapter', function () {
|
|
|
585
624
|
});
|
|
586
625
|
|
|
587
626
|
it('should parse JSON value', function () {
|
|
588
|
-
const data = JSON.stringify({
|
|
589
|
-
const {
|
|
627
|
+
const data = JSON.stringify({event: 'send'});
|
|
628
|
+
const {event} = tryParseJSON(data);
|
|
590
629
|
expect(event).to.be.equal('send');
|
|
591
630
|
});
|
|
592
631
|
|