@@ -18,7 +18,7 @@ describe('VisxAdapter', function () {
18
18
let bid = {
19
19
'bidder' : 'visx' ,
20
20
'params' : {
21
- 'uid' : ' 903536'
21
+ 'uid' : 903536
22
22
} ,
23
23
'adUnitCode' : 'adunit-code' ,
24
24
'sizes' : [ [ 300 , 250 ] , [ 300 , 600 ] ] ,
@@ -40,6 +40,15 @@ describe('VisxAdapter', function () {
40
40
expect ( spec . isBidRequestValid ( bid ) ) . to . equal ( false ) ;
41
41
} ) ;
42
42
43
+ it ( 'should return false when uid can not be parsed as number' , function ( ) {
44
+ let bid = Object . assign ( { } , bid ) ;
45
+ delete bid . params ;
46
+ bid . params = {
47
+ 'uid' : 'sdvsdv'
48
+ } ;
49
+ expect ( spec . isBidRequestValid ( bid ) ) . to . equal ( false ) ;
50
+ } ) ;
51
+
43
52
it ( 'it should fail on invalid video bid' , function ( ) {
44
53
let videoBid = Object . assign ( { } , bid ) ;
45
54
videoBid . mediaTypes = {
@@ -102,7 +111,7 @@ describe('VisxAdapter', function () {
102
111
{
103
112
'bidder' : 'visx' ,
104
113
'params' : {
105
- 'uid' : 903535
114
+ 'uid' : ' 903535'
106
115
} ,
107
116
'adUnitCode' : 'adunit-code-2' ,
108
117
'sizes' : [ [ 728 , 90 ] , [ 300 , 250 ] ] ,
@@ -1263,9 +1272,10 @@ describe('VisxAdapter', function () {
1263
1272
} ) ;
1264
1273
1265
1274
it ( 'onTimeout' , function ( ) {
1266
- const data = { timeout : 3000 , bidId : '23423' , params : { uid : 1 } } ;
1275
+ const data = [ { timeout : 3000 , adUnitCode : 'adunit-code-1' , auctionId : '1cbd2feafe5e8b' , bidder : 'visx' , bidId : '23423' , params : [ { uid : '1' } ] } ] ;
1276
+ const expectedData = [ { ...data [ 0 ] , params : [ { uid : 1 } ] } ] ;
1267
1277
spec . onTimeout ( data ) ;
1268
- expect ( utils . triggerPixel . calledOnceWith ( 'https://t.visx.net/track/bid_timeout//' + JSON . stringify ( data ) ) ) . to . equal ( true ) ;
1278
+ expect ( utils . triggerPixel . calledOnceWith ( 'https://t.visx.net/track/bid_timeout//' + JSON . stringify ( expectedData ) ) ) . to . equal ( true ) ;
1269
1279
} ) ;
1270
1280
} ) ;
1271
1281
0 commit comments