@@ -18,8 +18,8 @@ describe('nextMillenniumBidAdapterTests', () => {
1818 {
1919 title : 'imp - banner' ,
2020 data : {
21+ impId : '5' ,
2122 id : '123' ,
22- postBody : { ext : { nextMillennium : { refresh_counts : { } , elemOffsets : { } } } } ,
2323 bid : {
2424 mediaTypes : { banner : { sizes : [ [ 300 , 250 ] , [ 320 , 250 ] ] } } ,
2525 adUnitCode : 'test-banner-1' ,
@@ -37,7 +37,7 @@ describe('nextMillenniumBidAdapterTests', () => {
3737 } ,
3838
3939 expected : {
40- id : 'e36ea395f67f ' ,
40+ id : '5 ' ,
4141 bidfloorcur : 'EUR' ,
4242 bidfloor : 1.11 ,
4343 ext : { prebid : { storedrequest : { id : '123' } } } ,
@@ -53,8 +53,8 @@ describe('nextMillenniumBidAdapterTests', () => {
5353 {
5454 title : 'imp - video' ,
5555 data : {
56+ impId : '3' ,
5657 id : '234' ,
57- postBody : { ext : { nextMillennium : { refresh_counts : { } , elemOffsets : { } } } } ,
5858 bid : {
5959 mediaTypes : { video : { playerSize : [ 400 , 300 ] , api : [ 2 ] , placement : 1 , plcmt : 1 } } ,
6060 adUnitCode : 'test-video-1' ,
@@ -71,7 +71,7 @@ describe('nextMillenniumBidAdapterTests', () => {
7171 } ,
7272
7373 expected : {
74- id : 'e36ea395f67f ' ,
74+ id : '3 ' ,
7575 bidfloorcur : 'USD' ,
7676 ext : { prebid : { storedrequest : { id : '234' } } } ,
7777 video : {
@@ -89,8 +89,8 @@ describe('nextMillenniumBidAdapterTests', () => {
8989 {
9090 title : 'imp - mediaTypes.video is empty' ,
9191 data : {
92+ impId : '4' ,
9293 id : '234' ,
93- postBody : { ext : { nextMillennium : { refresh_counts : { } , elemOffsets : { } } } } ,
9494 bid : {
9595 mediaTypes : { video : { w : 640 , h : 480 } } ,
9696 bidId : 'e36ea395f67f' ,
@@ -105,7 +105,7 @@ describe('nextMillenniumBidAdapterTests', () => {
105105 } ,
106106
107107 expected : {
108- id : 'e36ea395f67f ' ,
108+ id : '4 ' ,
109109 bidfloorcur : 'USD' ,
110110 ext : { prebid : { storedrequest : { id : '234' } } } ,
111111 video : { w : 640 , h : 480 , mimes : [ 'video/mp4' , 'video/x-ms-wmv' , 'application/javascript' ] } ,
@@ -115,8 +115,8 @@ describe('nextMillenniumBidAdapterTests', () => {
115115 {
116116 title : 'imp with gpid' ,
117117 data : {
118+ impId : '2' ,
118119 id : '123' ,
119- postBody : { ext : { nextMillennium : { refresh_counts : { } , elemOffsets : { } } } } ,
120120 bid : {
121121 mediaTypes : { banner : { sizes : [ [ 300 , 250 ] , [ 320 , 250 ] ] } } ,
122122 adUnitCode : 'test-gpid-1' ,
@@ -132,7 +132,7 @@ describe('nextMillenniumBidAdapterTests', () => {
132132 } ,
133133
134134 expected : {
135- id : 'e36ea395f67a ' ,
135+ id : '2 ' ,
136136 ext : {
137137 prebid : { storedrequest : { id : '123' } } ,
138138 gpid : 'imp-gpid-123'
@@ -144,8 +144,8 @@ describe('nextMillenniumBidAdapterTests', () => {
144144 {
145145 title : 'imp with pbadslot' ,
146146 data : {
147+ impId : '1' ,
147148 id : '123' ,
148- postBody : { ext : { nextMillennium : { refresh_counts : { } , elemOffsets : { } } } } ,
149149 bid : {
150150 mediaTypes : { banner : { sizes : [ [ 300 , 250 ] , [ 320 , 250 ] ] } } ,
151151 adUnitCode : 'test-gpid-1' ,
@@ -167,7 +167,7 @@ describe('nextMillenniumBidAdapterTests', () => {
167167 } ,
168168
169169 expected : {
170- id : 'e36ea395f67a ' ,
170+ id : '1 ' ,
171171 ext : {
172172 prebid : { storedrequest : { id : '123' } } ,
173173 } ,
@@ -178,8 +178,8 @@ describe('nextMillenniumBidAdapterTests', () => {
178178
179179 for ( const { title, data, expected} of dataTests ) {
180180 it ( title , ( ) => {
181- const { bid, id, mediaTypes, postBody } = data ;
182- const imp = getImp ( bid , id , mediaTypes , postBody ) ;
181+ const { impId , bid, id, mediaTypes} = data ;
182+ const imp = getImp ( impId , bid , id , mediaTypes ) ;
183183 expect ( imp ) . to . deep . equal ( expected ) ;
184184 } ) ;
185185 }
@@ -900,17 +900,17 @@ describe('nextMillenniumBidAdapterTests', () => {
900900 describe ( 'Check ext.next_mil_imps' , function ( ) {
901901 const expectedNextMilImps = [
902902 {
903- impId : 'bid1234 ' ,
903+ impId : '1 ' ,
904904 nextMillennium : { refresh_count : 1 } ,
905905 } ,
906906
907907 {
908- impId : 'bid1235 ' ,
908+ impId : '2 ' ,
909909 nextMillennium : { refresh_count : 1 } ,
910910 } ,
911911
912912 {
913- impId : 'bid1236 ' ,
913+ impId : '3 ' ,
914914 nextMillennium : { refresh_count : 1 } ,
915915 } ,
916916 ] ;
@@ -1183,6 +1183,12 @@ describe('nextMillenniumBidAdapterTests', () => {
11831183 expect ( requestData . id ) . to . equal ( expected . id ) ;
11841184 expect ( requestData . tmax ) . to . equal ( expected . tmax ) ;
11851185 expect ( requestData ?. imp ?. length ) . to . equal ( expected . impSize ) ;
1186+
1187+ for ( let i = 0 ; i < bidRequests . length ; i ++ ) {
1188+ const impId = String ( i + 1 ) ;
1189+ expect ( impId ) . to . equal ( requestData . imp [ i ] . id ) ;
1190+ expect ( bidRequests [ i ] . bidId ) . to . equal ( request [ 0 ] . bidIds . get ( impId ) ) ;
1191+ } ;
11861192 } ) ;
11871193 } ;
11881194 } ) ;
@@ -1199,7 +1205,7 @@ describe('nextMillenniumBidAdapterTests', () => {
11991205 bid : [
12001206 {
12011207 id : '7457329903666272789-0' ,
1202- impid : '700ce0a43f72 ' ,
1208+ impid : '1 ' ,
12031209 price : 0.5 ,
12041210 adm : 'Hello! It\'s a test ad!' ,
12051211 adid : '96846035-0' ,
@@ -1210,7 +1216,7 @@ describe('nextMillenniumBidAdapterTests', () => {
12101216
12111217 {
12121218 id : '7457329903666272789-1' ,
1213- impid : '700ce0a43f73 ' ,
1219+ impid : '2 ' ,
12141220 price : 0.7 ,
12151221 adm : 'https://some_vast_host.com/vast.xml' ,
12161222 adid : '96846035-1' ,
@@ -1222,7 +1228,7 @@ describe('nextMillenniumBidAdapterTests', () => {
12221228
12231229 {
12241230 id : '7457329903666272789-2' ,
1225- impid : '700ce0a43f74 ' ,
1231+ impid : '3 ' ,
12261232 price : 1.0 ,
12271233 adm : '<vast><ad></ad></vast>' ,
12281234 adid : '96846035-3' ,
@@ -1238,6 +1244,14 @@ describe('nextMillenniumBidAdapterTests', () => {
12381244 } ,
12391245 } ,
12401246
1247+ bidRequest : {
1248+ bidIds : new Map ( [
1249+ [ '1' , '700ce0a43f72' ] ,
1250+ [ '2' , '700ce0a43f73' ] ,
1251+ [ '3' , '700ce0a43f74' ] ,
1252+ ] ) ,
1253+ } ,
1254+
12411255 expected : [
12421256 {
12431257 title : 'banner' ,
@@ -1308,15 +1322,19 @@ describe('nextMillenniumBidAdapterTests', () => {
13081322 const tests = [
13091323 {
13101324 title : 'parameters adSlots and allowedAds are empty' ,
1325+ impId : '1' ,
13111326 bid : {
13121327 params : { } ,
13131328 } ,
13141329
1315- expected : { } ,
1330+ expected : {
1331+ impId : '1' ,
1332+ } ,
13161333 } ,
13171334
13181335 {
13191336 title : 'parameters adSlots and allowedAds' ,
1337+ impId : '2' ,
13201338 bid : {
13211339 params : {
13221340 adSlots : [ 'test1' ] ,
@@ -1325,15 +1343,17 @@ describe('nextMillenniumBidAdapterTests', () => {
13251343 } ,
13261344
13271345 expected : {
1346+ impId : '2' ,
13281347 adSlots : [ 'test1' ] ,
13291348 allowedAds : [ 'test2' ] ,
13301349 } ,
13311350 } ,
13321351 ] ;
13331352
1334- for ( const { title, bid, expected} of tests ) {
1353+ for ( const { title, impId , bid, expected} of tests ) {
13351354 it ( title , ( ) => {
1336- const extNextMilImp = getExtNextMilImp ( bid ) ;
1355+ const extNextMilImp = getExtNextMilImp ( impId , bid ) ;
1356+ expect ( extNextMilImp . impId ) . to . deep . equal ( expected . impId ) ;
13371357 expect ( extNextMilImp . nextMillennium . adSlots ) . to . deep . equal ( expected . adSlots ) ;
13381358 expect ( extNextMilImp . nextMillennium . allowedAds ) . to . deep . equal ( expected . allowedAds ) ;
13391359 } ) ;
0 commit comments