@@ -48,8 +48,8 @@ describe('adnuntiusBidAdapter', function () {
48
48
'destination' : 'http://google.com'
49
49
} ,
50
50
'cpm' : { 'amount' : 5.0 , 'currency' : 'NOK' } ,
51
- 'bid' : { 'amount' : 5.0 , 'currency' : 'NOK' } ,
52
- 'cost' : { 'amount' : 5.0 , 'currency' : 'NOK' } ,
51
+ 'bid' : { 'amount' : 0.005 , 'currency' : 'NOK' } ,
52
+ 'cost' : { 'amount' : 0.005 , 'currency' : 'NOK' } ,
53
53
'impressionTrackingUrls' : [ ] ,
54
54
'impressionTrackingUrlsEsc' : [ ] ,
55
55
'adId' : 'adn-id-1347343135' ,
@@ -106,12 +106,14 @@ describe('adnuntiusBidAdapter', function () {
106
106
const request = spec . buildRequests ( bidRequests ) ;
107
107
const interpretedResponse = spec . interpretResponse ( serverResponse , request [ 0 ] ) ;
108
108
const ad = serverResponse . body . adUnits [ 0 ] . ads [ 0 ]
109
+ const cpm = ( ad . cpc && ad . cpm ) ? ad . bid . amount + ad . cpm . amount : ( ad . cpm ) ? ad . cpm . amount : 0 ;
110
+
109
111
expect ( interpretedResponse ) . to . have . lengthOf ( 1 ) ;
110
112
expect ( interpretedResponse [ 0 ] . cpm ) . to . equal ( ad . cpm . amount ) ;
111
113
expect ( interpretedResponse [ 0 ] . width ) . to . equal ( Number ( ad . creativeWidth ) ) ;
112
114
expect ( interpretedResponse [ 0 ] . height ) . to . equal ( Number ( ad . creativeHeight ) ) ;
113
115
expect ( interpretedResponse [ 0 ] . creativeId ) . to . equal ( ad . creativeId ) ;
114
- expect ( interpretedResponse [ 0 ] . currency ) . to . equal ( ad . cpm . currency ) ;
116
+ expect ( interpretedResponse [ 0 ] . currency ) . to . equal ( ad . bid . currency ) ;
115
117
expect ( interpretedResponse [ 0 ] . netRevenue ) . to . equal ( false ) ;
116
118
expect ( interpretedResponse [ 0 ] . ad ) . to . equal ( serverResponse . body . adUnits [ 0 ] . html ) ;
117
119
expect ( interpretedResponse [ 0 ] . ttl ) . to . equal ( 360 ) ;
0 commit comments