@@ -116,7 +116,41 @@ describe('iqmAdapter', function () {
116
116
bidderRequestsCount : 1 ,
117
117
bidderWinsCount : 0 } ] ;
118
118
119
- let bidderRequest = { bidderCode : 'iqm' , auctionId : '565ab569-ab95-40d6-8b42-b9707a92062f' , bidderRequestId : '13c05d264c7ffe' , bids : [ { bidder : 'iqm' , params : { publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' , placementId : 23451 , bidfloor : 0.5 } , crumbs : { pubcid : 'a0f51f64-6d86-41d0-abaf-7ece71404d94' } , fpd : { context : { pbAdSlot : '/19968336/header-bid-tag-0' } } , mediaTypes : { banner : { sizes : [ [ 300 , 250 ] ] } } , adUnitCode : '/19968336/header-bid-tag-0' , transactionId : '56fe8d92-ff6e-4c34-90ad-2f743cd0eae8' , sizes : [ [ 300 , 250 ] ] , bidId : '266d810da21904' , bidderRequestId : '13c05d264c7ffe' , auctionId : '565ab569-ab95-40d6-8b42-b9707a92062f' , src : 'client' , bidRequestsCount : 1 , bidderRequestsCount : 1 , bidderWinsCount : 0 } ] , auctionStart : 1615205942159 , timeout : 7000 , refererInfo : { referer : 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' , reachedTop : true , isAmp : false , numIframes : 0 , stack : [ 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' ] , canonicalUrl : null } , start : 1615205942162 } ;
119
+ let bidderRequest = {
120
+ bidderCode : 'iqm' ,
121
+ auctionId : '565ab569-ab95-40d6-8b42-b9707a92062f' ,
122
+ bidderRequestId : '13c05d264c7ffe' ,
123
+ bids : [ {
124
+ bidder : 'iqm' ,
125
+ params : { publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' , placementId : 23451 , bidfloor : 0.5 } ,
126
+ crumbs : { pubcid : 'a0f51f64-6d86-41d0-abaf-7ece71404d94' } ,
127
+ fpd : { context : { pbAdSlot : '/19968336/header-bid-tag-0' } } ,
128
+ mediaTypes : { banner : { sizes : [ [ 300 , 250 ] ] } } ,
129
+ adUnitCode : '/19968336/header-bid-tag-0' ,
130
+ transactionId : '56fe8d92-ff6e-4c34-90ad-2f743cd0eae8' ,
131
+ sizes : [ [ 300 , 250 ] ] ,
132
+ bidId : '266d810da21904' ,
133
+ bidderRequestId : '13c05d264c7ffe' ,
134
+ auctionId : '565ab569-ab95-40d6-8b42-b9707a92062f' ,
135
+ src : 'client' ,
136
+ bidRequestsCount : 1 ,
137
+ bidderRequestsCount : 1 ,
138
+ bidderWinsCount : 0
139
+ } ] ,
140
+ auctionStart : 1615205942159 ,
141
+ timeout : 7000 ,
142
+ refererInfo : {
143
+ page : 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' ,
144
+ domain : 'test.localhost.com:9999' ,
145
+ ref : null ,
146
+ reachedTop : true ,
147
+ isAmp : false ,
148
+ numIframes : 0 ,
149
+ stack : [ 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' ] ,
150
+ canonicalUrl : null
151
+ } ,
152
+ start : 1615205942162
153
+ } ;
120
154
121
155
it ( 'should parse out sizes' , function ( ) {
122
156
let temp = [ ] ;
@@ -142,7 +176,52 @@ describe('iqmAdapter', function () {
142
176
} ) ;
143
177
it ( 'should attach valid video params to the tag' , function ( ) {
144
178
let validBidRequests_video = [ { bidder : 'iqm' , params : { publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' , placementId : 23451 , bidfloor : 0.5 , video : { placement : 2 , mimes : [ 'video/mp4' ] , protocols : [ 2 , 5 ] , skipppable : true , playback_method : [ 'auto_play_sound_off' ] } } , crumbs : { pubcid : '09b8f065-9d1b-4a36-bd0c-ea22e2dad807' } , fpd : { context : { pbAdSlot : 'video1' } } , mediaTypes : { video : { playerSize : [ [ 640 , 480 ] ] , context : 'instream' } } , adUnitCode : 'video1' , transactionId : '86795c66-acf9-4dd5-998f-6d5362aaa541' , sizes : [ [ 640 , 480 ] ] , bidId : '28bfb7e2d12897' , bidderRequestId : '16e1ce8481bc6d' , auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' , src : 'client' , bidRequestsCount : 1 , bidderRequestsCount : 1 , bidderWinsCount : 0 } ] ;
145
- let bidderRequest_video = { bidderCode : 'iqm' , auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' , bidderRequestId : '16e1ce8481bc6d' , bids : [ { bidder : 'iqm' , params : { publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' , placementId : 23451 , bidfloor : 0.5 , video : { placement : 2 , mimes : [ 'video/mp4' ] , protocols : [ 2 , 5 ] , skipppable : true , playback_method : [ 'auto_play_sound_off' ] } } , crumbs : { pubcid : '09b8f065-9d1b-4a36-bd0c-ea22e2dad807' } , fpd : { context : { pbAdSlot : 'video1' } } , mediaTypes : { video : { playerSize : [ [ 640 , 480 ] ] , context : 'instream' } } , adUnitCode : 'video1' , transactionId : '86795c66-acf9-4dd5-998f-6d5362aaa541' , sizes : [ [ 640 , 480 ] ] , bidId : '28bfb7e2d12897' , bidderRequestId : '16e1ce8481bc6d' , auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' , src : 'client' , bidRequestsCount : 1 , bidderRequestsCount : 1 , bidderWinsCount : 0 } ] , auctionStart : 1615271191985 , timeout : 3000 , refererInfo : { referer : 'http://test.localhost:9999/integrationExamples/gpt/pbjs_video_adUnit.html' , reachedTop : true , isAmp : false , numIframes : 0 , stack : [ 'http://test.localhost:9999/integrationExamples/gpt/pbjs_video_adUnit.html' ] , canonicalUrl : null } , start : 1615271191988 } ;
179
+ let bidderRequest_video = {
180
+ bidderCode : 'iqm' ,
181
+ auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' ,
182
+ bidderRequestId : '16e1ce8481bc6d' ,
183
+ bids : [ {
184
+ bidder : 'iqm' ,
185
+ params : {
186
+ publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' ,
187
+ placementId : 23451 ,
188
+ bidfloor : 0.5 ,
189
+ video : {
190
+ placement : 2 ,
191
+ mimes : [ 'video/mp4' ] ,
192
+ protocols : [ 2 , 5 ] ,
193
+ skipppable : true ,
194
+ playback_method : [ 'auto_play_sound_off' ]
195
+ }
196
+ } ,
197
+ crumbs : { pubcid : '09b8f065-9d1b-4a36-bd0c-ea22e2dad807' } ,
198
+ fpd : { context : { pbAdSlot : 'video1' } } ,
199
+ mediaTypes : { video : { playerSize : [ [ 640 , 480 ] ] , context : 'instream' } } ,
200
+ adUnitCode : 'video1' ,
201
+ transactionId : '86795c66-acf9-4dd5-998f-6d5362aaa541' ,
202
+ sizes : [ [ 640 , 480 ] ] ,
203
+ bidId : '28bfb7e2d12897' ,
204
+ bidderRequestId : '16e1ce8481bc6d' ,
205
+ auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' ,
206
+ src : 'client' ,
207
+ bidRequestsCount : 1 ,
208
+ bidderRequestsCount : 1 ,
209
+ bidderWinsCount : 0
210
+ } ] ,
211
+ auctionStart : 1615271191985 ,
212
+ timeout : 3000 ,
213
+ refererInfo : {
214
+ page : 'http://test.localhost:9999/integrationExamples/gpt/pbjs_video_adUnit.html' ,
215
+ domain : 'test.localhost.com:9999' ,
216
+ ref : null ,
217
+ reachedTop : true ,
218
+ isAmp : false ,
219
+ numIframes : 0 ,
220
+ stack : [ 'http://test.localhost:9999/integrationExamples/gpt/pbjs_video_adUnit.html' ] ,
221
+ canonicalUrl : null
222
+ } ,
223
+ start : 1615271191988
224
+ } ;
146
225
const request = spec . buildRequests ( validBidRequests_video , bidderRequest_video ) ;
147
226
const payload = request [ 0 ] . data ;
148
227
expect ( payload . imp . id ) . to . exist ;
@@ -161,11 +240,13 @@ describe('iqmAdapter', function () {
161
240
} ) ;
162
241
163
242
it ( 'should add referer info to payload' , function ( ) {
243
+ // TODO: this is wrong on multiple levels
244
+ // The payload contains everything in `bidderRequest`; that is sometimes not even serializable
245
+ // this should not be testing the validity of internal Prebid structures
164
246
const request = spec . buildRequests ( validBidRequests , bidderRequest ) ;
165
247
const payload = request [ 0 ] . data ;
166
248
167
249
expect ( payload . bidderRequest . refererInfo ) . to . exist ;
168
- expect ( payload . bidderRequest . refererInfo ) . to . deep . equal ( { referer : 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' , reachedTop : true , isAmp : false , numIframes : 0 , stack : [ 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' ] , canonicalUrl : null } ) ;
169
250
} ) ;
170
251
} )
171
252
@@ -193,7 +274,41 @@ describe('iqmAdapter', function () {
193
274
bidRequestsCount : 1 ,
194
275
bidderRequestsCount : 1 ,
195
276
bidderWinsCount : 0 } ] ;
196
- let bidderRequest = { bidderCode : 'iqm' , auctionId : '565ab569-ab95-40d6-8b42-b9707a92062f' , bidderRequestId : '13c05d264c7ffe' , bids : [ { bidder : 'iqm' , params : { publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' , placementId : 23451 , bidfloor : 0.5 } , crumbs : { pubcid : 'a0f51f64-6d86-41d0-abaf-7ece71404d94' } , fpd : { context : { pbAdSlot : '/19968336/header-bid-tag-0' } } , mediaTypes : { banner : { sizes : [ [ 300 , 250 ] ] } } , adUnitCode : '/19968336/header-bid-tag-0' , transactionId : '56fe8d92-ff6e-4c34-90ad-2f743cd0eae8' , sizes : [ [ 300 , 250 ] ] , bidId : '266d810da21904' , bidderRequestId : '13c05d264c7ffe' , auctionId : '565ab569-ab95-40d6-8b42-b9707a92062f' , src : 'client' , bidRequestsCount : 1 , bidderRequestsCount : 1 , bidderWinsCount : 0 } ] , auctionStart : 1615205942159 , timeout : 7000 , refererInfo : { referer : 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' , reachedTop : true , isAmp : false , numIframes : 0 , stack : [ 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' ] , canonicalUrl : null } , start : 1615205942162 } ;
277
+ let bidderRequest = {
278
+ bidderCode : 'iqm' ,
279
+ auctionId : '565ab569-ab95-40d6-8b42-b9707a92062f' ,
280
+ bidderRequestId : '13c05d264c7ffe' ,
281
+ bids : [ {
282
+ bidder : 'iqm' ,
283
+ params : { publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' , placementId : 23451 , bidfloor : 0.5 } ,
284
+ crumbs : { pubcid : 'a0f51f64-6d86-41d0-abaf-7ece71404d94' } ,
285
+ fpd : { context : { pbAdSlot : '/19968336/header-bid-tag-0' } } ,
286
+ mediaTypes : { banner : { sizes : [ [ 300 , 250 ] ] } } ,
287
+ adUnitCode : '/19968336/header-bid-tag-0' ,
288
+ transactionId : '56fe8d92-ff6e-4c34-90ad-2f743cd0eae8' ,
289
+ sizes : [ [ 300 , 250 ] ] ,
290
+ bidId : '266d810da21904' ,
291
+ bidderRequestId : '13c05d264c7ffe' ,
292
+ auctionId : '565ab569-ab95-40d6-8b42-b9707a92062f' ,
293
+ src : 'client' ,
294
+ bidRequestsCount : 1 ,
295
+ bidderRequestsCount : 1 ,
296
+ bidderWinsCount : 0
297
+ } ] ,
298
+ auctionStart : 1615205942159 ,
299
+ timeout : 7000 ,
300
+ refererInfo : {
301
+ page : 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' ,
302
+ domain : 'test.localhost.com:9999' ,
303
+ ref : null ,
304
+ reachedTop : true ,
305
+ isAmp : false ,
306
+ numIframes : 0 ,
307
+ stack : [ 'http://test.localhost:9999/integrationExamples/gpt/hello_world.html' ] ,
308
+ canonicalUrl : null
309
+ } ,
310
+ start : 1615205942162
311
+ } ;
197
312
let response = {
198
313
199
314
id : '5bdbab92aae961cfbdf7465d' ,
@@ -213,7 +328,52 @@ describe('iqmAdapter', function () {
213
328
214
329
let validBidRequests_temp_video =
215
330
[ { bidder : 'iqm' , params : { publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' , placementId : 23451 , bidfloor : 0.5 , video : { placement : 2 , mimes : [ 'video/mp4' ] , protocols : [ 2 , 5 ] , skipppable : true , playback_method : [ 'auto_play_sound_off' ] } } , crumbs : { pubcid : 'cd86c3ff-d630-40e6-83ab-420e9e800594' } , fpd : { context : { pbAdSlot : 'video1' } } , mediaTypes : { video : { playerSize : [ [ 640 , 480 ] ] , context : 'instream' } } , adUnitCode : 'video1' , transactionId : '8335b266-7a41-45f9-86a2-92fdc7cf0cd9' , sizes : [ [ 640 , 480 ] ] , bidId : '26274beff25455' , bidderRequestId : '17c5d8c3168761' , auctionId : '2c592dcf-7dfc-4823-8203-dd1ebab77fe0' , src : 'client' , bidRequestsCount : 1 , bidderRequestsCount : 1 , bidderWinsCount : 0 } ] ;
216
- let bidderRequest_video = { bidderCode : 'iqm' , auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' , bidderRequestId : '16e1ce8481bc6d' , bids : [ { bidder : 'iqm' , params : { publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' , placementId : 23451 , bidfloor : 0.5 , video : { placement : 2 , mimes : [ 'video/mp4' ] , protocols : [ 2 , 5 ] , skipppable : true , playback_method : [ 'auto_play_sound_off' ] } } , crumbs : { pubcid : '09b8f065-9d1b-4a36-bd0c-ea22e2dad807' } , fpd : { context : { pbAdSlot : 'video1' } } , mediaTypes : { video : { playerSize : [ [ 640 , 480 ] ] , context : 'instream' } } , adUnitCode : 'video1' , transactionId : '86795c66-acf9-4dd5-998f-6d5362aaa541' , sizes : [ [ 640 , 480 ] ] , bidId : '28bfb7e2d12897' , bidderRequestId : '16e1ce8481bc6d' , auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' , src : 'client' , bidRequestsCount : 1 , bidderRequestsCount : 1 , bidderWinsCount : 0 } ] , auctionStart : 1615271191985 , timeout : 3000 , refererInfo : { referer : 'http://test.localhost:9999/integrationExamples/gpt/pbjs_video_adUnit.html' , reachedTop : true , isAmp : false , numIframes : 0 , stack : [ 'http://test.localhost:9999/integrationExamples/gpt/pbjs_video_adUnit.html' ] , canonicalUrl : null } , start : 1615271191988 } ;
331
+ let bidderRequest_video = {
332
+ bidderCode : 'iqm' ,
333
+ auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' ,
334
+ bidderRequestId : '16e1ce8481bc6d' ,
335
+ bids : [ {
336
+ bidder : 'iqm' ,
337
+ params : {
338
+ publisherId : 'df5fd732-c5f3-11e7-abc4-cec278b6b50a' ,
339
+ placementId : 23451 ,
340
+ bidfloor : 0.5 ,
341
+ video : {
342
+ placement : 2 ,
343
+ mimes : [ 'video/mp4' ] ,
344
+ protocols : [ 2 , 5 ] ,
345
+ skipppable : true ,
346
+ playback_method : [ 'auto_play_sound_off' ]
347
+ }
348
+ } ,
349
+ crumbs : { pubcid : '09b8f065-9d1b-4a36-bd0c-ea22e2dad807' } ,
350
+ fpd : { context : { pbAdSlot : 'video1' } } ,
351
+ mediaTypes : { video : { playerSize : [ [ 640 , 480 ] ] , context : 'instream' } } ,
352
+ adUnitCode : 'video1' ,
353
+ transactionId : '86795c66-acf9-4dd5-998f-6d5362aaa541' ,
354
+ sizes : [ [ 640 , 480 ] ] ,
355
+ bidId : '28bfb7e2d12897' ,
356
+ bidderRequestId : '16e1ce8481bc6d' ,
357
+ auctionId : '3140a2ec-d567-4db0-9bbb-eb6fa20ccb71' ,
358
+ src : 'client' ,
359
+ bidRequestsCount : 1 ,
360
+ bidderRequestsCount : 1 ,
361
+ bidderWinsCount : 0
362
+ } ] ,
363
+ auctionStart : 1615271191985 ,
364
+ timeout : 3000 ,
365
+ refererInfo : {
366
+ page : 'http://test.localhost:9999/integrationExamples/gpt/pbjs_video_adUnit.html' ,
367
+ domain : 'test.localhost.com:9999' ,
368
+ ref : '' ,
369
+ reachedTop : true ,
370
+ isAmp : false ,
371
+ numIframes : 0 ,
372
+ stack : [ 'http://test.localhost:9999/integrationExamples/gpt/pbjs_video_adUnit.html' ] ,
373
+ canonicalUrl : null
374
+ } ,
375
+ start : 1615271191988
376
+ } ;
217
377
218
378
it ( 'handles non-banner media responses' , function ( ) {
219
379
let response = { id : '2341234' , seatbid : [ { bid : [ { id : 'bid-2341234-1' , impid : '1' , price : 9 , nurl : 'https://frontend.stage.iqm.com/static/vast-01.xml' , adm : 'http://cdn.iqm.com/pbd?raw=312730_203cf73dc83fb_2824348636878_pbd' , adomain : [ 'app1.stage.iqm.com' ] , cid : '168900' , crid : 'cr-304503' , attr : [ ] } ] } ] , bidid : '2341234' } ;
0 commit comments