@@ -5,59 +5,71 @@ import * as utils from 'src/utils';
5
5
describe ( 'Adkernel adapter' , function ( ) {
6
6
const bid1_zone1 = {
7
7
bidder : 'adkernel' ,
8
- bidId : 'Bid_01' ,
9
8
params : { zoneId : 1 , host : 'rtb.adkernel.com' } ,
10
9
adUnitCode : 'ad-unit-1' ,
10
+ bidId : 'Bid_01' ,
11
+ bidderRequestId : 'req-001' ,
12
+ auctionId : 'auc-001' ,
11
13
mediaTypes : {
12
14
banner : {
13
15
sizes : [ [ 300 , 250 ] , [ 300 , 200 ] ]
14
16
}
15
17
}
16
18
} , bid2_zone2 = {
17
19
bidder : 'adkernel' ,
18
- bidId : 'Bid_02' ,
19
20
params : { zoneId : 2 , host : 'rtb.adkernel.com' } ,
20
21
adUnitCode : 'ad-unit-2' ,
22
+ bidId : 'Bid_02' ,
23
+ bidderRequestId : 'req-001' ,
24
+ auctionId : 'auc-001' ,
21
25
mediaTypes : {
22
26
banner : {
23
- sizes : [ 728 , 90 ]
27
+ sizes : [ [ 728 , 90 ] ]
24
28
}
25
29
}
26
30
} , bid3_host2 = {
27
31
bidder : 'adkernel' ,
28
- bidId : 'Bid_02' ,
29
32
params : { zoneId : 1 , host : 'rtb-private.adkernel.com' } ,
30
33
adUnitCode : 'ad-unit-2' ,
34
+ bidId : 'Bid_02' ,
35
+ bidderRequestId : 'req-001' ,
36
+ auctionId : 'auc-001' ,
31
37
mediaTypes : {
32
38
banner : {
33
39
sizes : [ [ 728 , 90 ] ]
34
40
}
35
41
}
36
42
} , bid_without_zone = {
37
43
bidder : 'adkernel' ,
38
- bidId : 'Bid_W' ,
39
44
params : { host : 'rtb-private.adkernel.com' } ,
40
45
adUnitCode : 'ad-unit-1' ,
46
+ bidId : 'Bid_W' ,
47
+ bidderRequestId : 'req-002' ,
48
+ auctionId : 'auc-002' ,
41
49
mediaTypes : {
42
50
banner : {
43
51
sizes : [ [ 728 , 90 ] ]
44
52
}
45
53
}
46
54
} , bid_without_host = {
47
55
bidder : 'adkernel' ,
48
- bidId : 'Bid_W' ,
49
56
params : { zoneId : 1 } ,
50
57
adUnitCode : 'ad-unit-1' ,
58
+ bidId : 'Bid_W' ,
59
+ bidderRequestId : 'req-002' ,
60
+ auctionId : 'auc-002' ,
51
61
mediaTypes : {
52
62
banner : {
53
63
sizes : [ [ 728 , 90 ] ]
54
64
}
55
65
}
56
66
} , bid_with_wrong_zoneId = {
57
67
bidder : 'adkernel' ,
58
- bidId : 'Bid_02' ,
59
68
params : { zoneId : 'wrong id' , host : 'rtb.adkernel.com' } ,
60
69
adUnitCode : 'ad-unit-2' ,
70
+ bidId : 'Bid_02' ,
71
+ bidderRequestId : 'req-002' ,
72
+ auctionId : 'auc-002' ,
61
73
mediaTypes : {
62
74
banner : {
63
75
sizes : [ [ 728 , 90 ] ]
@@ -72,7 +84,8 @@ describe('Adkernel adapter', function () {
72
84
sizes : [ [ 640 , 480 ] ] ,
73
85
params : {
74
86
zoneId : 1 ,
75
- host : 'rtb.adkernel.com'
87
+ host : 'rtb.adkernel.com' ,
88
+ video : { api : [ 1 , 2 ] }
76
89
} ,
77
90
mediaTypes : {
78
91
video : {
@@ -81,6 +94,19 @@ describe('Adkernel adapter', function () {
81
94
}
82
95
} ,
83
96
adUnitCode : 'ad-unit-1'
97
+ } , bid_multiformat = {
98
+ bidder : 'adkernel' ,
99
+ params : { zoneId : 1 , host : 'rtb.adkernel.com' } ,
100
+ mediaTypes : {
101
+ banner : { sizes : [ [ 300 , 250 ] , [ 300 , 200 ] ] } ,
102
+ video : { context : 'instream' , playerSize : [ [ 640 , 480 ] ] }
103
+ } ,
104
+ adUnitCode : 'ad-unit-1' ,
105
+ transactionId : 'f82c64b8-c602-42a4-9791-4a268f6559ed' ,
106
+ sizes : [ [ 300 , 250 ] , [ 300 , 200 ] ] ,
107
+ bidId : 'Bid_01' ,
108
+ bidderRequestId : 'req-001' ,
109
+ auctionId : 'auc-001'
84
110
} ;
85
111
86
112
const bidResponse1 = {
@@ -183,6 +209,11 @@ describe('Adkernel adapter', function () {
183
209
expect ( bidRequest . imp [ 0 ] ) . to . have . property ( 'banner' ) ;
184
210
} ) ;
185
211
212
+ it ( 'should have id' , function ( ) {
213
+ expect ( bidRequest . imp [ 0 ] ) . to . have . property ( 'id' ) ;
214
+ expect ( bidRequest . imp [ 0 ] . id ) . to . be . eql ( 'Bid_01' ) ;
215
+ } ) ;
216
+
186
217
it ( 'should have w/h' , function ( ) {
187
218
expect ( bidRequest . imp [ 0 ] . banner ) . to . have . property ( 'format' ) ;
188
219
expect ( bidRequest . imp [ 0 ] . banner . format ) . to . be . eql ( [ { w : 300 , h : 250 } , { w : 300 , h : 200 } ] ) ;
@@ -257,6 +288,27 @@ describe('Adkernel adapter', function () {
257
288
it ( 'should have tagid' , function ( ) {
258
289
expect ( bidRequests [ 0 ] . imp [ 0 ] ) . to . have . property ( 'tagid' , 'ad-unit-1' ) ;
259
290
} ) ;
291
+
292
+ it ( 'should have openrtb video impression parameters' , function ( ) {
293
+ expect ( bidRequests [ 0 ] . imp [ 0 ] . video ) . to . have . property ( 'api' ) ;
294
+ expect ( bidRequests [ 0 ] . imp [ 0 ] . video . api ) . to . be . eql ( [ 1 , 2 ] ) ;
295
+ } ) ;
296
+ } ) ;
297
+
298
+ describe ( 'multiformat request building' , function ( ) {
299
+ let _ , bidRequests ;
300
+ before ( function ( ) {
301
+ [ _ , bidRequests ] = buildRequest ( [ bid_multiformat ] ) ;
302
+ } ) ;
303
+ it ( 'should contain single request' , function ( ) {
304
+ expect ( bidRequests ) . to . have . length ( 1 ) ;
305
+ expect ( bidRequests [ 0 ] . imp ) . to . have . length ( 1 ) ;
306
+ } ) ;
307
+ it ( 'should contain banner-only impression' , function ( ) {
308
+ expect ( bidRequests [ 0 ] . imp ) . to . have . length ( 1 ) ;
309
+ expect ( bidRequests [ 0 ] . imp [ 0 ] ) . to . have . property ( 'banner' ) ;
310
+ expect ( bidRequests [ 0 ] . imp [ 0 ] ) . to . not . have . property ( 'video' ) ;
311
+ } ) ;
260
312
} ) ;
261
313
262
314
describe ( 'requests routing' , function ( ) {
0 commit comments