prebid.js 7.40.0 → 7.41.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/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/aduptechBidAdapter.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/browsiBidAdapter.js +1 -0
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/cleanmedianetBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- 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/dfpAdServerVideo.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/freewheel-sspBidAdapter.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/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/kargoBidAdapter.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/minutemediaplusBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +130 -129
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.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/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubwiseBidAdapter.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/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/stvBidAdapter.js +1 -0
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/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/yandexBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/x-domain/creative.html +1 -1
- package/modules/aduptechBidAdapter.js +43 -37
- package/modules/browsiBidAdapter.js +171 -0
- package/modules/browsiBidAdapter.md +38 -0
- package/modules/cleanmedianetBidAdapter.js +191 -126
- package/modules/cleanmedianetBidAdapter.md +64 -18
- package/modules/conversantBidAdapter.js +4 -0
- package/modules/dfpAdServerVideo.js +8 -8
- package/modules/freewheel-sspBidAdapter.js +9 -0
- package/modules/gridBidAdapter.js +12 -1
- package/modules/ixBidAdapter.js +1 -1
- package/modules/missenaBidAdapter.js +2 -1
- package/modules/neuwoRtdProvider.js +1 -1
- package/modules/nobidBidAdapter.js +13 -2
- package/modules/nobidBidAdapter.md +2 -2
- package/modules/permutiveRtdProvider.js +8 -2
- package/modules/pubwiseBidAdapter.js +265 -33
- package/modules/stvBidAdapter.js +330 -0
- package/modules/stvBidAdapter.md +62 -0
- package/modules/yandexBidAdapter.js +259 -71
- package/modules/yandexBidAdapter.md +52 -15
- package/package.json +1 -1
- package/src/videoCache.js +4 -4
- package/test/spec/modules/browsiBidAdapter_spec.js +209 -0
- package/test/spec/modules/cleanmedianetBidAdapter_spec.js +462 -407
- package/test/spec/modules/conversantBidAdapter_spec.js +8 -0
- package/test/spec/modules/dfpAdServerVideo_spec.js +36 -4
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/gridBidAdapter_spec.js +24 -0
- package/test/spec/modules/ixBidAdapter_spec.js +4 -4
- package/test/spec/modules/nobidBidAdapter_spec.js +32 -0
- package/test/spec/modules/permutiveRtdProvider_spec.js +61 -4
- package/test/spec/modules/pubwiseBidAdapter_spec.js +313 -3
- package/test/spec/modules/stvBidAdapter_spec.js +402 -0
- package/test/spec/modules/yandexBidAdapter_spec.js +315 -45
- package/test/spec/videoCache_spec.js +23 -0
- package/dist/flocIdSystem.js +0 -1
- package/modules/flocIdSystem.js +0 -0
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
import { assert, expect } from 'chai';
|
|
2
|
-
import { spec } from 'modules/yandexBidAdapter.js';
|
|
2
|
+
import { spec, NATIVE_ASSETS } from 'modules/yandexBidAdapter.js';
|
|
3
3
|
import { parseUrl } from 'src/utils.js';
|
|
4
|
-
import { BANNER } from '../../../src/mediaTypes';
|
|
4
|
+
import { BANNER, NATIVE } from '../../../src/mediaTypes';
|
|
5
|
+
import {OPENRTB} from '../../../modules/rtbhouseBidAdapter';
|
|
5
6
|
|
|
6
7
|
describe('Yandex adapter', function () {
|
|
7
|
-
function getBidConfig() {
|
|
8
|
-
return {
|
|
9
|
-
bidder: 'yandex',
|
|
10
|
-
params: {
|
|
11
|
-
placementId: '123-1',
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function getBidRequest() {
|
|
17
|
-
return {
|
|
18
|
-
...getBidConfig(),
|
|
19
|
-
bidId: 'bidid-1',
|
|
20
|
-
adUnitCode: 'adUnit-123',
|
|
21
|
-
mediaTypes: {
|
|
22
|
-
banner: {
|
|
23
|
-
sizes: [
|
|
24
|
-
[300, 250],
|
|
25
|
-
[300, 600]
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
8
|
describe('isBidRequestValid', function () {
|
|
33
9
|
it('should return true when required params found', function () {
|
|
34
10
|
const bid = getBidRequest();
|
|
@@ -65,19 +41,17 @@ describe('Yandex adapter', function () {
|
|
|
65
41
|
});
|
|
66
42
|
|
|
67
43
|
describe('buildRequests', function () {
|
|
68
|
-
const gdprConsent = {
|
|
69
|
-
gdprApplies: 1,
|
|
70
|
-
consentString: 'concent-string',
|
|
71
|
-
apiVersion: 1,
|
|
72
|
-
};
|
|
73
|
-
|
|
74
44
|
const bidderRequest = {
|
|
75
45
|
refererInfo: {
|
|
76
46
|
domain: 'ya.ru',
|
|
77
47
|
ref: 'https://ya.ru/',
|
|
78
48
|
page: 'https://ya.ru/',
|
|
79
49
|
},
|
|
80
|
-
gdprConsent
|
|
50
|
+
gdprConsent: {
|
|
51
|
+
gdprApplies: 1,
|
|
52
|
+
consentString: 'concent-string',
|
|
53
|
+
apiVersion: 1,
|
|
54
|
+
},
|
|
81
55
|
};
|
|
82
56
|
|
|
83
57
|
it('creates a valid banner request', function () {
|
|
@@ -101,7 +75,7 @@ describe('Yandex adapter', function () {
|
|
|
101
75
|
const { search: query } = parsedRequestUrl
|
|
102
76
|
|
|
103
77
|
expect(parsedRequestUrl.hostname).to.equal('bs.yandex.ru');
|
|
104
|
-
expect(parsedRequestUrl.pathname).to.equal('/
|
|
78
|
+
expect(parsedRequestUrl.pathname).to.equal('/prebid/123');
|
|
105
79
|
|
|
106
80
|
expect(query['imp-id']).to.equal('1');
|
|
107
81
|
expect(query['target-ref']).to.equal('ya.ru');
|
|
@@ -112,21 +86,197 @@ describe('Yandex adapter', function () {
|
|
|
112
86
|
|
|
113
87
|
expect(request.data).to.exist;
|
|
114
88
|
expect(data.site).to.not.equal(null);
|
|
115
|
-
expect(data.site.
|
|
116
|
-
expect(data.site.
|
|
89
|
+
expect(data.site.page).to.equal('https://ya.ru/');
|
|
90
|
+
expect(data.site.ref).to.equal('https://ya.ru/');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('banner', () => {
|
|
94
|
+
it('should create valid banner object', () => {
|
|
95
|
+
const bannerRequest = getBidRequest({
|
|
96
|
+
mediaTypes: {
|
|
97
|
+
banner: {
|
|
98
|
+
sizes: [
|
|
99
|
+
[300, 250],
|
|
100
|
+
[300, 600]
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
});
|
|
117
105
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
// expect(data.device.h).to.equal(window.innerHeight);
|
|
106
|
+
const requests = spec.buildRequests([bannerRequest], bidderRequest);
|
|
107
|
+
expect(requests[0].data.imp).to.have.lengthOf(1);
|
|
121
108
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
109
|
+
const imp = requests[0].data.imp[0];
|
|
110
|
+
expect(imp.banner).to.not.equal(null);
|
|
111
|
+
expect(imp.banner.w).to.equal(300);
|
|
112
|
+
expect(imp.banner.h).to.equal(250);
|
|
113
|
+
|
|
114
|
+
expect(imp.banner.format).to.deep.equal([
|
|
115
|
+
{ w: 300, h: 250 },
|
|
116
|
+
{ w: 300, h: 600 },
|
|
117
|
+
]);
|
|
118
|
+
});
|
|
126
119
|
});
|
|
120
|
+
|
|
121
|
+
describe('native', () => {
|
|
122
|
+
function buildRequestAndGetNativeParams(extra) {
|
|
123
|
+
const bannerRequest = getBidRequest(extra);
|
|
124
|
+
const requests = spec.buildRequests([bannerRequest], bidderRequest);
|
|
125
|
+
|
|
126
|
+
return JSON.parse(requests[0].data.imp[0].native.request);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
it('should extract native params', () => {
|
|
130
|
+
const nativeParams = buildRequestAndGetNativeParams({
|
|
131
|
+
mediaTypes: {
|
|
132
|
+
native: {
|
|
133
|
+
title: {
|
|
134
|
+
required: true,
|
|
135
|
+
len: 100,
|
|
136
|
+
},
|
|
137
|
+
body: {
|
|
138
|
+
len: 90
|
|
139
|
+
},
|
|
140
|
+
body2: {
|
|
141
|
+
len: 90
|
|
142
|
+
},
|
|
143
|
+
sponsoredBy: {
|
|
144
|
+
len: 25,
|
|
145
|
+
},
|
|
146
|
+
icon: {
|
|
147
|
+
sizes: [32, 32],
|
|
148
|
+
},
|
|
149
|
+
image: {
|
|
150
|
+
required: true,
|
|
151
|
+
sizes: [300, 250],
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
const sortedAssetsList = nativeParams.assets.sort((a, b) => a.id - b.id);
|
|
157
|
+
|
|
158
|
+
expect(sortedAssetsList).to.deep.equal([
|
|
159
|
+
{
|
|
160
|
+
id: NATIVE_ASSETS.title[0],
|
|
161
|
+
required: 1,
|
|
162
|
+
title: {
|
|
163
|
+
len: 100,
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: NATIVE_ASSETS.body[0],
|
|
168
|
+
data: {
|
|
169
|
+
type: NATIVE_ASSETS.body[1],
|
|
170
|
+
len: 90,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: NATIVE_ASSETS.body2[0],
|
|
175
|
+
data: {
|
|
176
|
+
type: NATIVE_ASSETS.body2[1],
|
|
177
|
+
len: 90,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: NATIVE_ASSETS.sponsoredBy[0],
|
|
182
|
+
data: {
|
|
183
|
+
type: NATIVE_ASSETS.sponsoredBy[1],
|
|
184
|
+
len: 25,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: NATIVE_ASSETS.icon[0],
|
|
189
|
+
img: {
|
|
190
|
+
type: NATIVE_ASSETS.icon[1],
|
|
191
|
+
w: 32,
|
|
192
|
+
h: 32,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: NATIVE_ASSETS.image[0],
|
|
197
|
+
required: 1,
|
|
198
|
+
img: {
|
|
199
|
+
type: NATIVE_ASSETS.image[1],
|
|
200
|
+
w: 300,
|
|
201
|
+
h: 250,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
]);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('should parse multiple image sizes', () => {
|
|
208
|
+
const nativeParams = buildRequestAndGetNativeParams({
|
|
209
|
+
mediaTypes: {
|
|
210
|
+
native: {
|
|
211
|
+
image: {
|
|
212
|
+
sizes: [[300, 250], [100, 100]],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
expect(nativeParams.assets[0]).to.deep.equal({
|
|
219
|
+
id: NATIVE_ASSETS.image[0],
|
|
220
|
+
img: {
|
|
221
|
+
type: NATIVE_ASSETS.image[1],
|
|
222
|
+
w: 300,
|
|
223
|
+
h: 250,
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it('should parse aspect ratios with min_width', () => {
|
|
229
|
+
const nativeParams = buildRequestAndGetNativeParams({
|
|
230
|
+
mediaTypes: {
|
|
231
|
+
native: {
|
|
232
|
+
image: {
|
|
233
|
+
aspect_ratios: [{
|
|
234
|
+
min_width: 320,
|
|
235
|
+
ratio_width: 4,
|
|
236
|
+
ratio_height: 3,
|
|
237
|
+
}],
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
expect(nativeParams.assets[0]).to.deep.equal({
|
|
244
|
+
id: NATIVE_ASSETS.image[0],
|
|
245
|
+
img: {
|
|
246
|
+
type: NATIVE_ASSETS.image[1],
|
|
247
|
+
wmin: 320,
|
|
248
|
+
hmin: 240,
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
it('should parse aspect ratios without min_width', () => {
|
|
254
|
+
const nativeParams = buildRequestAndGetNativeParams({
|
|
255
|
+
mediaTypes: {
|
|
256
|
+
native: {
|
|
257
|
+
image: {
|
|
258
|
+
aspect_ratios: [{
|
|
259
|
+
ratio_width: 4,
|
|
260
|
+
ratio_height: 3,
|
|
261
|
+
}],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
expect(nativeParams.assets[0]).to.deep.equal({
|
|
268
|
+
id: NATIVE_ASSETS.image[0],
|
|
269
|
+
img: {
|
|
270
|
+
type: NATIVE_ASSETS.image[1],
|
|
271
|
+
wmin: 100,
|
|
272
|
+
hmin: 75,
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
})
|
|
127
277
|
});
|
|
128
278
|
|
|
129
|
-
describe('
|
|
279
|
+
describe('interpretResponse', function () {
|
|
130
280
|
const bannerRequest = getBidRequest();
|
|
131
281
|
|
|
132
282
|
const bannerResponse = {
|
|
@@ -172,5 +322,125 @@ describe('Yandex adapter', function () {
|
|
|
172
322
|
|
|
173
323
|
expect(rtbBid.meta.advertiserDomains).to.deep.equal(['example.com']);
|
|
174
324
|
});
|
|
325
|
+
|
|
326
|
+
describe('native', () => {
|
|
327
|
+
function getNativeAdmResponse() {
|
|
328
|
+
return {
|
|
329
|
+
native: {
|
|
330
|
+
link: {
|
|
331
|
+
url: 'https://example.com'
|
|
332
|
+
},
|
|
333
|
+
imptrackers: [
|
|
334
|
+
'https://example.com/imptracker'
|
|
335
|
+
],
|
|
336
|
+
assets: [
|
|
337
|
+
{
|
|
338
|
+
title: {
|
|
339
|
+
text: 'title text',
|
|
340
|
+
},
|
|
341
|
+
id: NATIVE_ASSETS.title[0],
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
data: {
|
|
345
|
+
value: 'body text'
|
|
346
|
+
},
|
|
347
|
+
id: NATIVE_ASSETS.body[0],
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
data: {
|
|
351
|
+
value: 'sponsoredBy text'
|
|
352
|
+
},
|
|
353
|
+
id: NATIVE_ASSETS.sponsoredBy[0],
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
img: {
|
|
357
|
+
url: 'https://example.com/image',
|
|
358
|
+
w: 200,
|
|
359
|
+
h: 150,
|
|
360
|
+
},
|
|
361
|
+
id: NATIVE_ASSETS.image[0],
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
img: {
|
|
365
|
+
url: 'https://example.com/icon',
|
|
366
|
+
h: 32,
|
|
367
|
+
w: 32
|
|
368
|
+
},
|
|
369
|
+
id: NATIVE_ASSETS.icon[0],
|
|
370
|
+
},
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
it('handles native responses', function() {
|
|
377
|
+
bannerRequest.bidRequest = {
|
|
378
|
+
mediaType: NATIVE,
|
|
379
|
+
bidId: 'bidid-1',
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
const nativeAdmResponce = getNativeAdmResponse();
|
|
383
|
+
const bannerResponse = {
|
|
384
|
+
body: {
|
|
385
|
+
seatbid: [{
|
|
386
|
+
bid: [
|
|
387
|
+
{
|
|
388
|
+
impid: 1,
|
|
389
|
+
price: 0.3,
|
|
390
|
+
adomain: [
|
|
391
|
+
'example.com'
|
|
392
|
+
],
|
|
393
|
+
adid: 'yabs.123=',
|
|
394
|
+
adm: JSON.stringify(nativeAdmResponce),
|
|
395
|
+
},
|
|
396
|
+
],
|
|
397
|
+
}],
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
const result = spec.interpretResponse(bannerResponse, bannerRequest);
|
|
402
|
+
|
|
403
|
+
expect(result).to.have.lengthOf(1);
|
|
404
|
+
expect(result[0]).to.exist;
|
|
405
|
+
|
|
406
|
+
const bid = result[0];
|
|
407
|
+
expect(bid.meta.advertiserDomains).to.deep.equal(['example.com']);
|
|
408
|
+
expect(bid.native).to.deep.equal({
|
|
409
|
+
clickUrl: 'https://example.com',
|
|
410
|
+
impressionTrackers: ['https://example.com/imptracker'],
|
|
411
|
+
title: 'title text',
|
|
412
|
+
body: 'body text',
|
|
413
|
+
sponsoredBy: 'sponsoredBy text',
|
|
414
|
+
image: {
|
|
415
|
+
url: 'https://example.com/image',
|
|
416
|
+
width: 200,
|
|
417
|
+
height: 150,
|
|
418
|
+
},
|
|
419
|
+
icon: {
|
|
420
|
+
url: 'https://example.com/icon',
|
|
421
|
+
width: 32,
|
|
422
|
+
height: 32,
|
|
423
|
+
},
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
});
|
|
175
427
|
});
|
|
176
428
|
});
|
|
429
|
+
|
|
430
|
+
function getBidConfig() {
|
|
431
|
+
return {
|
|
432
|
+
bidder: 'yandex',
|
|
433
|
+
params: {
|
|
434
|
+
placementId: '123-1',
|
|
435
|
+
},
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function getBidRequest(extra = {}) {
|
|
440
|
+
return {
|
|
441
|
+
...getBidConfig(),
|
|
442
|
+
bidId: 'bidid-1',
|
|
443
|
+
adUnitCode: 'adUnit-123',
|
|
444
|
+
...extra,
|
|
445
|
+
};
|
|
446
|
+
}
|
|
@@ -72,6 +72,29 @@ describe('The video cache', function () {
|
|
|
72
72
|
config.resetConfig();
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
describe('cache.timeout', () => {
|
|
76
|
+
let getAjax, cb;
|
|
77
|
+
beforeEach(() => {
|
|
78
|
+
getAjax = sinon.stub().callsFake(() => sinon.stub());
|
|
79
|
+
cb = sinon.stub();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should be respected', () => {
|
|
83
|
+
config.setConfig({
|
|
84
|
+
cache: {
|
|
85
|
+
timeout: 1
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
store([{ vastUrl: 'my-mock-url.com' }], cb, getAjax);
|
|
89
|
+
sinon.assert.calledWith(getAjax, 1);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should use default when not specified', () => {
|
|
93
|
+
store([], cb, getAjax);
|
|
94
|
+
sinon.assert.calledWith(getAjax, undefined);
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
|
|
75
98
|
it('should execute the callback with a successful result when store() is called', function () {
|
|
76
99
|
const uuid = 'c488b101-af3e-4a99-b538-00423e5a3371';
|
|
77
100
|
const callback = fakeServerCall(
|
package/dist/flocIdSystem.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.pbjsChunk=self.pbjsChunk||[]).push([[18868],{84121:function(){window.pbjs.installedModules.push("flocIdSystem")}},function(n){n.O(0,[56866],(function(){return s=84121,n(n.s=s);var s}));n.O()}]);
|
package/modules/flocIdSystem.js
DELETED
|
File without changes
|