@@ -1347,90 +1347,91 @@ describe('S2S Adapter', function () {
1347
1347
adapter . callBids ( REQUEST , BID_REQUESTS , addBidResponse , done , ajax ) ;
1348
1348
const requestBid = JSON . parse ( server . requests [ 0 ] . requestBody ) ;
1349
1349
1350
- expect ( requestBid . imp [ 0 ] . native ) . to . deep . equal ( {
1351
- request : JSON . stringify ( {
1352
- 'context' : 1 ,
1353
- 'plcmttype' : 1 ,
1354
- 'eventtrackers' : [ {
1355
- event : 1 ,
1356
- methods : [ 1 ]
1357
- } ] ,
1358
- 'assets' : [
1359
- {
1360
- 'required' : 1 ,
1361
- 'id' : 0 ,
1362
- 'title' : {
1363
- 'len' : 800
1364
- }
1365
- } ,
1366
- {
1367
- 'required' : 1 ,
1368
- 'id' : 1 ,
1369
- 'img' : {
1370
- 'type' : 3 ,
1371
- 'w' : 989 ,
1372
- 'h' : 742
1373
- }
1374
- } ,
1375
- {
1376
- 'required' : 1 ,
1377
- 'id' : 2 ,
1378
- 'img' : {
1379
- 'type' : 1 ,
1380
- 'wmin' : 10 ,
1381
- 'hmin' : 10 ,
1382
- 'ext' : {
1383
- 'aspectratios' : [ '1:1' ]
1350
+ expect ( requestBid . imp [ 0 ] . native ) . to . deep . equal ( {
1351
+ request : JSON . stringify ( {
1352
+ 'context' : 1 ,
1353
+ 'plcmttype' : 1 ,
1354
+ 'eventtrackers' : [ {
1355
+ event : 1 ,
1356
+ methods : [ 1 ]
1357
+ } ] ,
1358
+ 'assets' : [
1359
+ {
1360
+ 'required' : 1 ,
1361
+ 'id' : 0 ,
1362
+ 'title' : {
1363
+ 'len' : 800
1364
+ }
1365
+ } ,
1366
+ {
1367
+ 'required' : 1 ,
1368
+ 'id' : 1 ,
1369
+ 'img' : {
1370
+ 'type' : 3 ,
1371
+ 'w' : 989 ,
1372
+ 'h' : 742
1373
+ }
1374
+ } ,
1375
+ {
1376
+ 'required' : 1 ,
1377
+ 'id' : 2 ,
1378
+ 'img' : {
1379
+ 'type' : 1 ,
1380
+ 'wmin' : 10 ,
1381
+ 'hmin' : 10 ,
1382
+ 'ext' : {
1383
+ 'aspectratios' : [ '1:1' ]
1384
+ }
1385
+ }
1386
+ } ,
1387
+ {
1388
+ 'required' : 1 ,
1389
+ 'id' : 3 ,
1390
+ 'data' : {
1391
+ 'type' : 1
1384
1392
}
1385
1393
}
1386
- } ,
1387
- {
1388
- 'required' : 1 ,
1389
- 'id' : 3 ,
1390
- 'data' : {
1391
- 'type' : 1
1392
- }
1393
- }
1394
- ]
1395
- } ) ,
1396
- ver : '1.2'
1394
+ ]
1395
+ } ) ,
1396
+ ver : '1.2'
1397
+ } ) ;
1397
1398
} ) ;
1398
- } ) ;
1399
1399
1400
- it ( 'adds native ortb request for OpenRTB' , function ( ) {
1401
- const _config = {
1402
- s2sConfig : CONFIG
1403
- } ;
1400
+ it ( 'adds native ortb request for OpenRTB' , function ( ) {
1401
+ const _config = {
1402
+ s2sConfig : CONFIG
1403
+ } ;
1404
1404
1405
- const openRtbNativeRequest = deepClone ( REQUEST ) ;
1406
- delete openRtbNativeRequest . ad_units [ 0 ] . mediaTypes . native ;
1407
- delete openRtbNativeRequest . ad_units [ 0 ] . nativeParams ;
1405
+ const openRtbNativeRequest = deepClone ( REQUEST ) ;
1406
+ delete openRtbNativeRequest . ad_units [ 0 ] . mediaTypes . native ;
1407
+ delete openRtbNativeRequest . ad_units [ 0 ] . nativeParams ;
1408
1408
1409
- openRtbNativeRequest . ad_units [ 0 ] . mediaTypes . native = NATIVE_ORTB_MTO ;
1410
- prepRequest ( openRtbNativeRequest ) ;
1409
+ openRtbNativeRequest . ad_units [ 0 ] . mediaTypes . native = NATIVE_ORTB_MTO ;
1410
+ prepRequest ( openRtbNativeRequest ) ;
1411
1411
1412
- config . setConfig ( _config ) ;
1413
- adapter . callBids ( openRtbNativeRequest , BID_REQUESTS , addBidResponse , done , ajax ) ;
1414
- const requestBid = JSON . parse ( server . requests [ 0 ] . requestBody ) ;
1412
+ config . setConfig ( _config ) ;
1413
+ adapter . callBids ( openRtbNativeRequest , BID_REQUESTS , addBidResponse , done , ajax ) ;
1414
+ const requestBid = JSON . parse ( server . requests [ 0 ] . requestBody ) ;
1415
1415
1416
- expect ( requestBid . imp [ 0 ] . native ) . to . deep . equal ( {
1417
- request : JSON . stringify ( NATIVE_ORTB_MTO . ortb ) ,
1418
- ver : '1.2'
1416
+ expect ( requestBid . imp [ 0 ] . native ) . to . deep . equal ( {
1417
+ request : JSON . stringify ( NATIVE_ORTB_MTO . ortb ) ,
1418
+ ver : '1.2'
1419
+ } ) ;
1419
1420
} ) ;
1420
- } ) ;
1421
1421
1422
- it ( 'should not include ext.aspectratios if adunit\'s aspect_ratios do not define radio_width and ratio_height' , ( ) => {
1423
- const req = deepClone ( REQUEST ) ;
1424
- req . ad_units [ 0 ] . mediaTypes . native . icon . aspect_ratios [ 0 ] = { 'min_width' : 1 , 'min_height' : 2 } ;
1425
- prepRequest ( req ) ;
1426
- adapter . callBids ( req , BID_REQUESTS , addBidResponse , done , ajax ) ;
1427
- const nativeReq = JSON . parse ( JSON . parse ( server . requests [ 0 ] . requestBody ) . imp [ 0 ] . native . request ) ;
1428
- const icons = nativeReq . assets . map ( ( a ) => a . img ) . filter ( ( img ) => img && img . type === 1 ) ;
1429
- expect ( icons ) . to . have . length ( 1 ) ;
1430
- expect ( icons [ 0 ] . hmin ) . to . equal ( 2 ) ;
1431
- expect ( icons [ 0 ] . wmin ) . to . equal ( 1 ) ;
1432
- expect ( deepAccess ( icons [ 0 ] , 'ext.aspectratios' ) ) . to . be . undefined ;
1433
- } )
1422
+ it ( 'should not include ext.aspectratios if adunit\'s aspect_ratios do not define radio_width and ratio_height' , ( ) => {
1423
+ const req = deepClone ( REQUEST ) ;
1424
+ req . ad_units [ 0 ] . mediaTypes . native . icon . aspect_ratios [ 0 ] = { 'min_width' : 1 , 'min_height' : 2 } ;
1425
+ prepRequest ( req ) ;
1426
+ adapter . callBids ( req , BID_REQUESTS , addBidResponse , done , ajax ) ;
1427
+ const nativeReq = JSON . parse ( JSON . parse ( server . requests [ 0 ] . requestBody ) . imp [ 0 ] . native . request ) ;
1428
+ const icons = nativeReq . assets . map ( ( a ) => a . img ) . filter ( ( img ) => img && img . type === 1 ) ;
1429
+ expect ( icons ) . to . have . length ( 1 ) ;
1430
+ expect ( icons [ 0 ] . hmin ) . to . equal ( 2 ) ;
1431
+ expect ( icons [ 0 ] . wmin ) . to . equal ( 1 ) ;
1432
+ expect ( deepAccess ( icons [ 0 ] , 'ext.aspectratios' ) ) . to . be . undefined ;
1433
+ } )
1434
+ } ) ;
1434
1435
1435
1436
it ( 'adds site if app is not present' , function ( ) {
1436
1437
const _config = {
0 commit comments