@@ -2,7 +2,7 @@ import { assert, expect } from 'chai';
2
2
import { spec , NATIVE_ASSETS } from 'modules/yandexBidAdapter.js' ;
3
3
import { parseUrl } from 'src/utils.js' ;
4
4
import { BANNER , NATIVE } from '../../../src/mediaTypes' ;
5
- import { OPENRTB } from '../../../modules/rtbhouseBidAdapter ' ;
5
+ import { config } from '../../../src/config ' ;
6
6
7
7
describe ( 'Yandex adapter' , function ( ) {
8
8
describe ( 'isBidRequestValid' , function ( ) {
@@ -90,6 +90,22 @@ describe('Yandex adapter', function () {
90
90
expect ( data . site . ref ) . to . equal ( 'https://ya.ru/' ) ;
91
91
} ) ;
92
92
93
+ it ( 'should send currency if defined' , function ( ) {
94
+ config . setConfig ( {
95
+ currency : {
96
+ adServerCurrency : 'USD'
97
+ }
98
+ } ) ;
99
+
100
+ const bannerRequest = getBidRequest ( ) ;
101
+ const requests = spec . buildRequests ( [ bannerRequest ] , bidderRequest ) ;
102
+ const { url } = requests [ 0 ] ;
103
+ const parsedRequestUrl = parseUrl ( url ) ;
104
+ const { search : query } = parsedRequestUrl
105
+
106
+ expect ( query [ 'ssp-cur' ] ) . to . equal ( 'USD' ) ;
107
+ } ) ;
108
+
93
109
describe ( 'banner' , ( ) => {
94
110
it ( 'should create valid banner object' , ( ) => {
95
111
const bannerRequest = getBidRequest ( {
@@ -273,7 +289,7 @@ describe('Yandex adapter', function () {
273
289
} ,
274
290
} ) ;
275
291
} ) ;
276
- } )
292
+ } ) ;
277
293
} ) ;
278
294
279
295
describe ( 'interpretResponse' , function ( ) {
@@ -294,6 +310,7 @@ describe('Yandex adapter', function () {
294
310
'example.com'
295
311
] ,
296
312
adid : 'yabs.123=' ,
313
+ nurl : 'https://example.com/nurl/?price=${AUCTION_PRICE}&cur=${AUCTION_CURRENCY}' ,
297
314
}
298
315
]
299
316
} ] ,
@@ -314,11 +331,12 @@ describe('Yandex adapter', function () {
314
331
const rtbBid = result [ 0 ] ;
315
332
expect ( rtbBid . width ) . to . equal ( 300 ) ;
316
333
expect ( rtbBid . height ) . to . equal ( 250 ) ;
317
- expect ( rtbBid . cpm ) . to . be . within ( 0.1 , 0.5 ) ;
334
+ expect ( rtbBid . cpm ) . to . be . within ( 0.3 , 0.3 ) ;
318
335
expect ( rtbBid . ad ) . to . equal ( '<!-- HTML/JS -->' ) ;
319
336
expect ( rtbBid . currency ) . to . equal ( 'USD' ) ;
320
337
expect ( rtbBid . netRevenue ) . to . equal ( true ) ;
321
338
expect ( rtbBid . ttl ) . to . equal ( 180 ) ;
339
+ expect ( rtbBid . nurl ) . to . equal ( 'https://example.com/nurl/?price=0.3&cur=USD' ) ;
322
340
323
341
expect ( rtbBid . meta . advertiserDomains ) . to . deep . equal ( [ 'example.com' ] ) ;
324
342
} ) ;
0 commit comments