prebid.js 7.49.0 → 7.50.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/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/beopBidAdapter.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/confiantRtdProvider.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/dependencies.json +3 -0
- 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/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/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/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.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/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +131 -130
- 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/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/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/silverpushBidAdapter.js +1 -0
- 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 -1
- 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/video.js +1 -1
- package/dist/videoModule.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/videoModule/eventsUI/eventsUI.css +205 -0
- package/integrationExamples/videoModule/eventsUI/eventsUI.js +181 -0
- package/integrationExamples/videoModule/jwplayer/eventsUI.html +295 -0
- package/integrationExamples/videoModule/videojs/eventsUI.html +319 -0
- package/libraries/video/shared/helpers.js +14 -0
- package/modules/33acrossBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +1 -0
- package/modules/beopBidAdapter.js +1 -0
- package/modules/confiantRtdProvider.js +15 -12
- package/modules/conversantAnalyticsAdapter.js +7 -5
- package/modules/conversantBidAdapter.js +1 -1
- package/modules/criteoBidAdapter.js +17 -1
- package/modules/gridBidAdapter.js +3 -0
- package/modules/liveIntentIdSystem.js +8 -4
- package/modules/magniteAnalyticsAdapter.js +26 -3
- package/modules/permutiveRtdProvider.js +9 -38
- package/modules/rubiconBidAdapter.js +6 -2
- package/modules/silverpushBidAdapter.js +326 -0
- package/modules/silverpushBidAdapter.md +107 -0
- package/modules/underdogmediaBidAdapter.js +2 -2
- package/modules/videoModule/adQueue.js +2 -2
- package/modules/videoModule/index.js +9 -5
- package/modules/yahoosspBidAdapter.js +6 -0
- package/modules/yahoosspBidAdapter.md +37 -0
- package/package.json +1 -1
- package/test/spec/modules/33acrossBidAdapter_spec.js +4 -3
- package/test/spec/modules/beopBidAdapter_spec.js +4 -0
- package/test/spec/modules/confiantRtdProvider_spec.js +4 -1
- package/test/spec/modules/conversantBidAdapter_spec.js +2 -1
- package/test/spec/modules/criteoBidAdapter_spec.js +109 -0
- package/test/spec/modules/gridBidAdapter_spec.js +3 -0
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +28 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +45 -0
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +16 -36
- package/test/spec/modules/mass_spec.js +2 -0
- package/test/spec/modules/permutiveRtdProvider_spec.js +0 -20
- package/test/spec/modules/rubiconBidAdapter_spec.js +143 -67
- package/test/spec/modules/silverpushBidAdapter_spec.js +394 -0
- package/test/spec/modules/underdogmediaBidAdapter_spec.js +1 -1
- package/test/spec/modules/videoModule/shared/helpers_spec.js +22 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +60 -1
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import * as utils from 'src/utils';
|
|
3
|
+
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
4
|
+
import { REQUEST_URL, SP_OUTSTREAM_PLAYER_URL, CONVERTER, spec } from '../../../modules/silverpushBidAdapter.js';
|
|
5
|
+
|
|
6
|
+
const bannerBid = {
|
|
7
|
+
bidder: 'silverpush',
|
|
8
|
+
params: {
|
|
9
|
+
publisherId: '012345',
|
|
10
|
+
bidFloor: 1.5
|
|
11
|
+
},
|
|
12
|
+
mediaTypes: {
|
|
13
|
+
banner: {
|
|
14
|
+
sizes: [
|
|
15
|
+
[300, 250],
|
|
16
|
+
[300, 50],
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
adUnitCode: 'div-gpt-ad-928572628472-0',
|
|
21
|
+
bidId: 'dl38fjf9d',
|
|
22
|
+
bidderRequestId: 'brid00000000',
|
|
23
|
+
auctionId: 'aucid0000000',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const videoBid = {
|
|
27
|
+
bidder: 'silverpush',
|
|
28
|
+
params: {
|
|
29
|
+
publisherId: '012345',
|
|
30
|
+
bidFloor: 0.1
|
|
31
|
+
},
|
|
32
|
+
mediaTypes: {
|
|
33
|
+
video: {
|
|
34
|
+
api: [1, 2, 4, 6],
|
|
35
|
+
mimes: ['video/mp4'],
|
|
36
|
+
playbackmethod: [2, 4, 6],
|
|
37
|
+
playerSize: [[1024, 768]],
|
|
38
|
+
protocols: [3, 4, 7, 8, 10],
|
|
39
|
+
placement: 1,
|
|
40
|
+
minduration: 0,
|
|
41
|
+
maxduration: 60,
|
|
42
|
+
startdelay: 0
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
adUnitCode: 'div-gpt-ad-928572628472-1',
|
|
46
|
+
bidId: '281141d3541362',
|
|
47
|
+
bidderRequestId: 'brid00000000',
|
|
48
|
+
auctionId: 'aucid0000000',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const bidderRequest = {
|
|
52
|
+
auctionId: 'aucid0000000',
|
|
53
|
+
bidderRequestId: 'brid00000000',
|
|
54
|
+
timeout: 200,
|
|
55
|
+
refererInfo: {
|
|
56
|
+
page: 'https://hello-world-page.com/',
|
|
57
|
+
domain: 'hello-world-page.com',
|
|
58
|
+
ref: 'http://example-domain.com/foo',
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const bannerReponse = {
|
|
63
|
+
'id': 'brid00000000',
|
|
64
|
+
'seatbid': [
|
|
65
|
+
{
|
|
66
|
+
'bid': [
|
|
67
|
+
{
|
|
68
|
+
'id': 'ARUYoUZx',
|
|
69
|
+
'impid': 'dl38fjf9d',
|
|
70
|
+
'price': 1.64,
|
|
71
|
+
'adid': 'aaaaadddddddd',
|
|
72
|
+
'burl': 'http://0.0.0.0:8181/burl',
|
|
73
|
+
'adm': '<div><img src="url_str"><div>',
|
|
74
|
+
'adomain': [
|
|
75
|
+
'https://www.exampleabc.com'
|
|
76
|
+
],
|
|
77
|
+
'iurl': 'https://example.example.com/2.png',
|
|
78
|
+
'cid': 'aaaaadddddddd',
|
|
79
|
+
'crid': 'aaaaadddddddd',
|
|
80
|
+
'h': 250,
|
|
81
|
+
'w': 300
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
'bidid': 'ARUYoUZx',
|
|
87
|
+
'cur': 'USD'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const videoResponse = {
|
|
91
|
+
'id': 'brid00000000',
|
|
92
|
+
'seatbid': [
|
|
93
|
+
{
|
|
94
|
+
'bid': [
|
|
95
|
+
{
|
|
96
|
+
'id': 'soCWeklh',
|
|
97
|
+
'impid': '281141d3541362',
|
|
98
|
+
'price': 1.09,
|
|
99
|
+
'adid': 'outstream_video',
|
|
100
|
+
'burl': 'http://0.0.0.0:8181/burl',
|
|
101
|
+
'adm': '<VAST version="4.2"></VAST>\n',
|
|
102
|
+
'adomain': [
|
|
103
|
+
'https://www.exampleabc.com'
|
|
104
|
+
],
|
|
105
|
+
'cid': '229369649',
|
|
106
|
+
'crid': 'aaaaadddddddd',
|
|
107
|
+
'h': 768,
|
|
108
|
+
'w': 1024
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
'bidid': 'soCWeklh',
|
|
114
|
+
'cur': 'USD'
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
describe('Silverpush Adapter', function () {
|
|
118
|
+
describe('isBidRequestValid()', () => {
|
|
119
|
+
it('should return false when publisherId is not defined', () => {
|
|
120
|
+
const bid = utils.deepClone(bannerBid);
|
|
121
|
+
delete bid.params.publisherId;
|
|
122
|
+
|
|
123
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('should return false when publisherId is empty string', () => {
|
|
127
|
+
const bid = utils.deepClone(bannerBid);
|
|
128
|
+
bid.params.publisherId = '';
|
|
129
|
+
|
|
130
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it('should return false when publisherId is a number', () => {
|
|
134
|
+
const bid = utils.deepClone(bannerBid);
|
|
135
|
+
bid.params.publisherId = 12345;
|
|
136
|
+
|
|
137
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('should return false when there is no banner in mediaTypes', () => {
|
|
141
|
+
const bid = utils.deepClone(bannerBid);
|
|
142
|
+
delete bid.mediaTypes.banner;
|
|
143
|
+
|
|
144
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('should return false when sizes for banner are not specified', () => {
|
|
148
|
+
const bid = utils.deepClone(bannerBid);
|
|
149
|
+
delete bid.mediaTypes.banner.sizes;
|
|
150
|
+
|
|
151
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('should return false when there is no video in mediaTypes', () => {
|
|
155
|
+
const bid = utils.deepClone(videoBid);
|
|
156
|
+
delete bid.mediaTypes.video;
|
|
157
|
+
|
|
158
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('should reutrn false if player size is not set', () => {
|
|
162
|
+
const bid = utils.deepClone(videoBid);
|
|
163
|
+
delete bid.mediaTypes.video.playerSize;
|
|
164
|
+
|
|
165
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('should return true when required params found', () => {
|
|
169
|
+
expect(spec.isBidRequestValid(bannerBid)).to.equal(true);
|
|
170
|
+
expect(spec.isBidRequestValid(videoBid)).to.equal(true);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
describe('buildRequests()', () => {
|
|
175
|
+
it('should build correct request for banner bid with both w, h', () => {
|
|
176
|
+
const bid = utils.deepClone(bannerBid);
|
|
177
|
+
|
|
178
|
+
const [request] = spec.buildRequests([bid], bidderRequest);
|
|
179
|
+
const requestData = request.data;
|
|
180
|
+
|
|
181
|
+
expect(requestData.imp[0].banner.w).to.equal(300);
|
|
182
|
+
expect(requestData.imp[0].banner.h).to.equal(250);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('should return default bidfloor when bidFloor is not defined', () => {
|
|
186
|
+
const bid = utils.deepClone(bannerBid);
|
|
187
|
+
delete bid.params.bidFloor;
|
|
188
|
+
|
|
189
|
+
const [request] = spec.buildRequests([bid], bidderRequest);
|
|
190
|
+
const requestData = request.data;
|
|
191
|
+
|
|
192
|
+
expect(requestData.imp[0].bidfloor).to.equal(0.05);
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('should contain deals in request if deal is specified in params', () => {
|
|
196
|
+
const bid = utils.deepClone(bannerBid);
|
|
197
|
+
bid.params.deals = [{ id: 'test' }];
|
|
198
|
+
|
|
199
|
+
const [request] = spec.buildRequests([bid], bidderRequest);
|
|
200
|
+
const requestData = request.data;
|
|
201
|
+
|
|
202
|
+
expect(requestData.imp[0].pmp.deals).to.equal(bid.params.deals);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it('should return bidfloor when bidFloor is defined', () => {
|
|
206
|
+
const bid = utils.deepClone(bannerBid);
|
|
207
|
+
|
|
208
|
+
const [request] = spec.buildRequests([bid], bidderRequest);
|
|
209
|
+
const requestData = request.data;
|
|
210
|
+
|
|
211
|
+
expect(requestData.imp[0].bidfloor).to.equal(bannerBid.params.bidFloor);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it('should build correct request for video bid with playerSize', () => {
|
|
215
|
+
const bid = utils.deepClone(videoBid);
|
|
216
|
+
|
|
217
|
+
const [request] = spec.buildRequests([bid], bidderRequest);
|
|
218
|
+
const requestData = request.data;
|
|
219
|
+
|
|
220
|
+
expect(requestData.imp[0].video.w).to.equal(1024);
|
|
221
|
+
expect(requestData.imp[0].video.h).to.equal(768);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it('should use bidder video params if they are set', () => {
|
|
225
|
+
const videoBidWithParams = utils.deepClone(videoBid);
|
|
226
|
+
const bidderVideoParams = {
|
|
227
|
+
api: [1, 2],
|
|
228
|
+
mimes: ['video/mp4', 'video/x-flv'],
|
|
229
|
+
playbackmethod: [3, 4],
|
|
230
|
+
protocols: [5, 6],
|
|
231
|
+
placement: 1,
|
|
232
|
+
minduration: 0,
|
|
233
|
+
maxduration: 60,
|
|
234
|
+
w: 1024,
|
|
235
|
+
h: 768,
|
|
236
|
+
startdelay: 0
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
videoBidWithParams.params.video = bidderVideoParams;
|
|
240
|
+
|
|
241
|
+
const requests = spec.buildRequests([videoBidWithParams], bidderRequest);
|
|
242
|
+
const request = requests[0].data;
|
|
243
|
+
|
|
244
|
+
expect(request.imp[0]).to.deep.include({
|
|
245
|
+
video: {
|
|
246
|
+
...bidderVideoParams,
|
|
247
|
+
w: videoBidWithParams.mediaTypes.video.playerSize[0][0],
|
|
248
|
+
h: videoBidWithParams.mediaTypes.video.playerSize[0][1],
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
describe('getOS()', () => {
|
|
255
|
+
it('shold return correct os name for Windows', () => {
|
|
256
|
+
let userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246';
|
|
257
|
+
let osName = spec.getOS(userAgent);
|
|
258
|
+
|
|
259
|
+
expect(osName).to.equal('Windows');
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it('shold return correct os name for Mac OS', () => {
|
|
263
|
+
let userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9';
|
|
264
|
+
let osName = spec.getOS(userAgent);
|
|
265
|
+
|
|
266
|
+
expect(osName).to.equal('macOS');
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it('shold return correct os name for Android', () => {
|
|
270
|
+
let userAgent = 'Mozilla/5.0 (Linux; Android 10; SM-G996U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36';
|
|
271
|
+
let osName = spec.getOS(userAgent);
|
|
272
|
+
|
|
273
|
+
expect(osName).to.equal('Android');
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it('shold return correct os name for ios', () => {
|
|
277
|
+
let userAgent = 'Mozilla/5.0 (iPhone14,3; U; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/19A346 Safari/602.1';
|
|
278
|
+
let osName = spec.getOS(userAgent);
|
|
279
|
+
|
|
280
|
+
expect(osName).to.equal('iOS');
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('shold return correct os name for Linux', () => {
|
|
284
|
+
let userAgent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1';
|
|
285
|
+
let osName = spec.getOS(userAgent);
|
|
286
|
+
|
|
287
|
+
expect(osName).to.equal('Linux');
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
describe('interpretResponse()', () => {
|
|
292
|
+
it('should return nbr to 0 when response not received', () => {
|
|
293
|
+
const requests = spec.buildRequests([bannerBid], bidderRequest);
|
|
294
|
+
const bids = spec.interpretResponse({ body: null }, requests[0]);
|
|
295
|
+
|
|
296
|
+
expect(bids[0]).to.equal(undefined);
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
it('should correctly interpret valid banner response', () => {
|
|
300
|
+
const response = utils.deepClone(bannerReponse);
|
|
301
|
+
const requests = spec.buildRequests([bannerBid], bidderRequest);
|
|
302
|
+
const bids = spec.interpretResponse({ body: response }, requests[0]);
|
|
303
|
+
|
|
304
|
+
expect(bids[0].ad).to.equal('<div><img src="url_str"><div>');
|
|
305
|
+
expect(bids[0].burl).to.equal('http://0.0.0.0:8181/burl');
|
|
306
|
+
expect(bids[0].cpm).to.equal(1.64);
|
|
307
|
+
expect(bids[0].creativeId).to.equal('aaaaadddddddd');
|
|
308
|
+
expect(bids[0].creative_id).to.equal('aaaaadddddddd');
|
|
309
|
+
expect(bids[0].currency).to.equal('USD');
|
|
310
|
+
expect(bids[0].height).to.equal(250);
|
|
311
|
+
expect(bids[0].mediaType).to.equal('banner');
|
|
312
|
+
expect(bids[0].meta.advertiserDomains[0]).to.equal('https://www.exampleabc.com');
|
|
313
|
+
expect(bids[0].netRevenue).to.equal(true);
|
|
314
|
+
expect(bids[0].requestId).to.equal('dl38fjf9d');
|
|
315
|
+
expect(bids[0].seatBidId).to.equal('ARUYoUZx');
|
|
316
|
+
expect(bids[0].ttl).to.equal(300);
|
|
317
|
+
expect(bids[0].width).to.equal(300);
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
if (FEATURES.VIDEO) {
|
|
321
|
+
it('should correctly interpret valid instream video response', () => {
|
|
322
|
+
const response = utils.deepClone(videoResponse);
|
|
323
|
+
videoBid.mediaTypes.video.context = 'outstream';
|
|
324
|
+
const requests = spec.buildRequests([videoBid], bidderRequest);
|
|
325
|
+
const bids = spec.interpretResponse({ body: response }, requests[0]);
|
|
326
|
+
|
|
327
|
+
expect(bids[0].vastXml).to.equal('<VAST version="4.2"></VAST>\n');
|
|
328
|
+
expect(bids[0].burl).to.equal('http://0.0.0.0:8181/burl');
|
|
329
|
+
expect(bids[0].cpm).to.equal(1.09);
|
|
330
|
+
expect(bids[0].creativeId).to.equal('aaaaadddddddd');
|
|
331
|
+
expect(bids[0].currency).to.equal('USD');
|
|
332
|
+
expect(bids[0].mediaType).to.equal('video');
|
|
333
|
+
expect(bids[0].meta.advertiserDomains[0]).to.equal('https://www.exampleabc.com');
|
|
334
|
+
expect(bids[0].requestId).to.equal('281141d3541362');
|
|
335
|
+
expect(bids[0].seatBidId).to.equal('soCWeklh');
|
|
336
|
+
expect(bids[0].width).to.equal(1024);
|
|
337
|
+
expect(bids[0].height).to.equal(768);
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
it('should correctly interpret valid outstream video response', () => {
|
|
341
|
+
const response = utils.deepClone(videoResponse);
|
|
342
|
+
videoBid.mediaTypes.video.context = 'outstream';
|
|
343
|
+
|
|
344
|
+
const requests = spec.buildRequests([videoBid], bidderRequest);
|
|
345
|
+
const bids = spec.interpretResponse({ body: response }, requests[0]);
|
|
346
|
+
|
|
347
|
+
expect(bids[0].vastXml).to.equal('<VAST version="4.2"></VAST>\n');
|
|
348
|
+
expect(bids[0].rendererUrl).to.equal(SP_OUTSTREAM_PLAYER_URL);
|
|
349
|
+
expect(bids[0].renderer.url).to.equal(SP_OUTSTREAM_PLAYER_URL);
|
|
350
|
+
expect(bids[0].burl).to.equal('http://0.0.0.0:8181/burl');
|
|
351
|
+
expect(bids[0].cpm).to.equal(1.09);
|
|
352
|
+
expect(bids[0].creativeId).to.equal('aaaaadddddddd');
|
|
353
|
+
expect(bids[0].currency).to.equal('USD');
|
|
354
|
+
expect(bids[0].mediaType).to.equal('video');
|
|
355
|
+
expect(bids[0].meta.advertiserDomains[0]).to.equal('https://www.exampleabc.com');
|
|
356
|
+
expect(bids[0].requestId).to.equal('281141d3541362');
|
|
357
|
+
expect(bids[0].seatBidId).to.equal('soCWeklh');
|
|
358
|
+
expect(bids[0].width).to.equal(1024);
|
|
359
|
+
expect(bids[0].height).to.equal(768);
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
describe('onBidWon', function() {
|
|
365
|
+
let ajaxStub;
|
|
366
|
+
|
|
367
|
+
beforeEach(() => {
|
|
368
|
+
ajaxStub = sinon.stub(spec, 'getRequest')
|
|
369
|
+
})
|
|
370
|
+
|
|
371
|
+
afterEach(() => {
|
|
372
|
+
ajaxStub.restore()
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
it('Should not trigger pixel if bid does not contain burl', function() {
|
|
376
|
+
const result = spec.onBidWon({});
|
|
377
|
+
|
|
378
|
+
expect(ajaxStub.calledOnce).to.equal(false);
|
|
379
|
+
})
|
|
380
|
+
|
|
381
|
+
it('Should trigger pixel with correct macros if bid burl is present', function() {
|
|
382
|
+
const result = spec.onBidWon({
|
|
383
|
+
cpm: 1.5,
|
|
384
|
+
auctionId: 'auc123',
|
|
385
|
+
requestId: 'req123',
|
|
386
|
+
adId: 'ad1234',
|
|
387
|
+
seatBidId: 'sea123',
|
|
388
|
+
burl: 'http://won.foo.bar/trk?ap=${AUCTION_PRICE}&aid=${AUCTION_ID}&imp=${AUCTION_IMP_ID}&adid=${AUCTION_AD_ID}&sid=${AUCTION_SEAT_ID}'
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
expect(ajaxStub.calledOnceWith('http://won.foo.bar/trk?ap=1.5&aid=auc123&imp=req123&adid=ad1234&sid=sea123')).to.equal(true);
|
|
392
|
+
})
|
|
393
|
+
})
|
|
394
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getExternalVideoEventName, getExternalVideoEventPayload } from 'libraries/video/shared/helpers.js';
|
|
2
|
+
import { expect } from 'chai';
|
|
3
|
+
|
|
4
|
+
describe('Helpers', function () {
|
|
5
|
+
describe('getExternalVideoEventName', function () {
|
|
6
|
+
it('should append video prefix and stay camelcase', function () {
|
|
7
|
+
expect(getExternalVideoEventName('eventName')).to.equal('videoEventName');
|
|
8
|
+
expect(getExternalVideoEventName(null)).to.equal('');
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('getExternalVideoEventPayload', function () {
|
|
13
|
+
it('should include type in payload when absent', function () {
|
|
14
|
+
const testType = 'testType';
|
|
15
|
+
const payloadWithType = { datum: 'datum', type: 'existingType' };
|
|
16
|
+
expect(getExternalVideoEventPayload(testType, payloadWithType).type).to.equal('existingType');
|
|
17
|
+
|
|
18
|
+
const payloadWithoutType = { datum: 'datum' };
|
|
19
|
+
expect(getExternalVideoEventPayload(testType, payloadWithoutType).type).to.equal(testType);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -481,6 +481,23 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
481
481
|
});
|
|
482
482
|
});
|
|
483
483
|
|
|
484
|
+
const VALID_PUBLISHER_OBJECTS = ['ext'];
|
|
485
|
+
VALID_PUBLISHER_OBJECTS.forEach(param => {
|
|
486
|
+
it(`should determine that the ortb2.site.publisher Object key is valid and append to the bid-request: ${JSON.stringify(param)}`, () => {
|
|
487
|
+
const ortb2 = {
|
|
488
|
+
site: {
|
|
489
|
+
publisher: {
|
|
490
|
+
[param]: {a: '123', b: '456'}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
const { validBidRequests, bidderRequest } = generateBuildRequestMock({ortb2});
|
|
495
|
+
const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data;
|
|
496
|
+
expect(data.site.publisher[param]).to.be.a('object');
|
|
497
|
+
expect(data.site.publisher[param]).to.be.equal(ortb2.site.publisher[param]);
|
|
498
|
+
});
|
|
499
|
+
});
|
|
500
|
+
|
|
484
501
|
const VALID_CONTENT_ARRAYS = ['cat'];
|
|
485
502
|
VALID_CONTENT_ARRAYS.forEach(param => {
|
|
486
503
|
it(`should determine that the ortb2.site Array key is valid and append to the bid-request: ${JSON.stringify(param)}`, () => {
|
|
@@ -512,7 +529,6 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
512
529
|
const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data;
|
|
513
530
|
expect(data.site.content[param]).to.be.a('object');
|
|
514
531
|
expect(data.site.content[param]).to.be.equal(ortb2.site.content[param]);
|
|
515
|
-
config.setConfig({ortb2: {}});
|
|
516
532
|
});
|
|
517
533
|
});
|
|
518
534
|
});
|
|
@@ -959,6 +975,49 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
959
975
|
expect(data.site.id).to.equal('1234567');
|
|
960
976
|
});
|
|
961
977
|
|
|
978
|
+
it('should use site publisher ortb2 config in default integration mode', () => {
|
|
979
|
+
const ortb2 = {
|
|
980
|
+
site: {
|
|
981
|
+
publisher: {
|
|
982
|
+
ext: {
|
|
983
|
+
publisherblob: 'pblob',
|
|
984
|
+
bucket: 'bucket'
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
let { validBidRequests, bidderRequest } = generateBuildRequestMock({ortb2});
|
|
990
|
+
const data = spec.buildRequests(validBidRequests, bidderRequest).data;
|
|
991
|
+
expect(data.site.publisher).to.deep.equal({
|
|
992
|
+
ext: {
|
|
993
|
+
publisherblob: 'pblob',
|
|
994
|
+
bucket: 'bucket'
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
it('should use site publisher ortb2 config when using "pubId" integration mode', () => {
|
|
1000
|
+
const ortb2 = {
|
|
1001
|
+
site: {
|
|
1002
|
+
publisher: {
|
|
1003
|
+
ext: {
|
|
1004
|
+
publisherblob: 'pblob',
|
|
1005
|
+
bucket: 'bucket'
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
let { validBidRequests, bidderRequest } = generateBuildRequestMock({pubIdMode: true, ortb2});
|
|
1011
|
+
const data = spec.buildRequests(validBidRequests, bidderRequest).data;
|
|
1012
|
+
expect(data.site.publisher).to.deep.equal({
|
|
1013
|
+
id: DEFAULT_PUBID,
|
|
1014
|
+
ext: {
|
|
1015
|
+
publisherblob: 'pblob',
|
|
1016
|
+
bucket: 'bucket'
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
});
|
|
1020
|
+
|
|
962
1021
|
it('should use placementId value as imp.tagid in the outbound bid-request when using "pubId" integration mode', () => {
|
|
963
1022
|
let { validBidRequests, bidderRequest } = generateBuildRequestMock({pubIdMode: true});
|
|
964
1023
|
validBidRequests[0].params.placementId = 'header-300x250';
|