@@ -25,6 +25,25 @@ describe('Zeta Ssp Bid Adapter', function () {
25
25
}
26
26
] ;
27
27
28
+ const params = {
29
+ user : {
30
+ uid : 222 ,
31
+ buyeruid : 333
32
+ } ,
33
+ tags : {
34
+ someTag : 444 ,
35
+ } ,
36
+ sid : 'publisherId' ,
37
+ shortname : 'test_shortname' ,
38
+ site : {
39
+ page : 'testPage'
40
+ } ,
41
+ app : {
42
+ bundle : 'testBundle'
43
+ } ,
44
+ test : 1
45
+ } ;
46
+
28
47
const bannerRequest = [ {
29
48
bidId : 12345 ,
30
49
auctionId : 67890 ,
@@ -41,18 +60,7 @@ describe('Zeta Ssp Bid Adapter', function () {
41
60
consentString : 'consentString'
42
61
} ,
43
62
uspConsent : 'someCCPAString' ,
44
- params : {
45
- placement : 111 ,
46
- user : {
47
- uid : 222 ,
48
- buyeruid : 333
49
- } ,
50
- tags : {
51
- someTag : 444 ,
52
- sid : 'publisherId'
53
- } ,
54
- test : 1
55
- } ,
63
+ params : params ,
56
64
userIdAsEids : eids
57
65
} ] ;
58
66
@@ -72,18 +80,7 @@ describe('Zeta Ssp Bid Adapter', function () {
72
80
refererInfo : {
73
81
referer : 'http://www.zetaglobal.com/page?param=video'
74
82
} ,
75
- params : {
76
- placement : 111 ,
77
- user : {
78
- uid : 222 ,
79
- buyeruid : 333
80
- } ,
81
- tags : {
82
- someTag : 444 ,
83
- sid : 'publisherId'
84
- } ,
85
- test : 1
86
- } ,
83
+ params : params
87
84
} ] ;
88
85
89
86
it ( 'Test the bid validation function' , function ( ) {
@@ -269,4 +266,20 @@ describe('Zeta Ssp Bid Adapter', function () {
269
266
270
267
expect ( payload . imp [ 0 ] . banner ) . to . be . undefined ;
271
268
} ) ;
269
+
270
+ it ( 'Test required params in banner request' , function ( ) {
271
+ const request = spec . buildRequests ( bannerRequest , bannerRequest [ 0 ] ) ;
272
+ const payload = JSON . parse ( request . data ) ;
273
+ expect ( payload . ext . sid ) . to . eql ( 'publisherId' ) ;
274
+ expect ( payload . ext . tags . someTag ) . to . eql ( 444 ) ;
275
+ expect ( payload . ext . tags . shortname ) . to . eql ( 'test_shortname' ) ;
276
+ } ) ;
277
+
278
+ it ( 'Test required params in video request' , function ( ) {
279
+ const request = spec . buildRequests ( videoRequest , videoRequest [ 0 ] ) ;
280
+ const payload = JSON . parse ( request . data ) ;
281
+ expect ( payload . ext . sid ) . to . eql ( 'publisherId' ) ;
282
+ expect ( payload . ext . tags . someTag ) . to . eql ( 444 ) ;
283
+ expect ( payload . ext . tags . shortname ) . to . eql ( 'test_shortname' ) ;
284
+ } ) ;
272
285
} ) ;
0 commit comments