@@ -273,6 +273,7 @@ const RESPONSE_OPENRTB = {
273
273
'seat' : 'appnexus'
274
274
} ,
275
275
] ,
276
+ 'cur' : 'EUR' ,
276
277
'ext' : {
277
278
'responsetimemillis' : {
278
279
'appnexus' : 8 ,
@@ -1402,6 +1403,26 @@ describe('S2S Adapter', function () {
1402
1403
} ) ;
1403
1404
} ) ;
1404
1405
1406
+ it ( 'should set the bidResponse currency to whats in the PBS response' , function ( ) {
1407
+ server . respondWith ( JSON . stringify ( RESPONSE_OPENRTB ) ) ;
1408
+ adapter . callBids ( REQUEST , BID_REQUESTS , addBidResponse , done , ajax ) ;
1409
+ server . respond ( ) ;
1410
+ sinon . assert . calledOnce ( addBidResponse ) ;
1411
+ const pbjsResponse = addBidResponse . firstCall . args [ 1 ] ;
1412
+ expect ( pbjsResponse ) . to . have . property ( 'currency' , 'EUR' ) ;
1413
+ } ) ;
1414
+
1415
+ it ( 'should set the default bidResponse currency when not specified in OpenRTB' , function ( ) {
1416
+ let modifiedResponse = utils . deepClone ( RESPONSE_OPENRTB ) ;
1417
+ modifiedResponse . cur = '' ;
1418
+ server . respondWith ( JSON . stringify ( modifiedResponse ) ) ;
1419
+ adapter . callBids ( REQUEST , BID_REQUESTS , addBidResponse , done , ajax ) ;
1420
+ server . respond ( ) ;
1421
+ sinon . assert . calledOnce ( addBidResponse ) ;
1422
+ const pbjsResponse = addBidResponse . firstCall . args [ 1 ] ;
1423
+ expect ( pbjsResponse ) . to . have . property ( 'currency' , 'USD' ) ;
1424
+ } ) ;
1425
+
1405
1426
it ( 'should pass through default adserverTargeting if present in bidObject for banner request' , function ( ) {
1406
1427
const cacheResponse = utils . deepClone ( RESPONSE_OPENRTB ) ;
1407
1428
0 commit comments