@@ -255,13 +255,46 @@ describe('ColossussspAdapter', function () {
255
255
} ) ;
256
256
257
257
describe ( 'buildRequests with user ids' , function ( ) {
258
- bid . userId = { }
259
- bid . userId . britepoolid = 'britepoolid123' ;
260
- bid . userId . idl_env = 'idl_env123' ;
261
- bid . userId . tdid = 'tdid123' ;
262
- bid . userId . id5id = { uid : 'id5id123' } ;
263
- bid . userId . uid2 = { id : 'uid2id123' } ;
264
- let serverRequest = spec . buildRequests ( [ bid ] , bidderRequest ) ;
258
+ var clonedBid = JSON . parse ( JSON . stringify ( bid ) ) ;
259
+ clonedBid . userId = { }
260
+ clonedBid . userId . britepoolid = 'britepoolid123' ;
261
+ clonedBid . userId . idl_env = 'idl_env123' ;
262
+ clonedBid . userId . tdid = 'tdid123' ;
263
+ clonedBid . userId . id5id = { uid : 'id5id123' } ;
264
+ clonedBid . userId . uid2 = { id : 'uid2id123' } ;
265
+ clonedBid . userIdAsEids = [
266
+ {
267
+ 'source' : 'pubcid.org' ,
268
+ 'uids' : [
269
+ {
270
+ 'id' : '4679e98e-1d83-4718-8aba-aa88hhhaaa' ,
271
+ 'atype' : 1
272
+ }
273
+ ]
274
+ } ,
275
+ {
276
+ 'source' : 'adserver.org' ,
277
+ 'uids' : [
278
+ {
279
+ 'id' : 'e804908e-57b4-4f46-a097-08be44321e79' ,
280
+ 'atype' : 1 ,
281
+ 'ext' : {
282
+ 'rtiPartner' : 'TDID'
283
+ }
284
+ }
285
+ ]
286
+ } ,
287
+ {
288
+ 'source' : 'neustar.biz' ,
289
+ 'uids' : [
290
+ {
291
+ 'id' : 'E1:Bvss1x8hXM2zHeqiqj2umJUziavSvLT6E_ORri5fDCsZb-5sfD18oNWycTmdx6QBNdbURBVv466hLJiKSwHCaTxvROo8smjqj6GfvlKfzQI' ,
292
+ 'atype' : 1
293
+ }
294
+ ]
295
+ }
296
+ ] ;
297
+ let serverRequest = spec . buildRequests ( [ clonedBid ] , bidderRequest ) ;
265
298
it ( 'Returns valid data if array of bids is valid' , function ( ) {
266
299
let data = serverRequest . data ;
267
300
let placements = data [ 'placements' ] ;
@@ -270,11 +303,11 @@ describe('ColossussspAdapter', function () {
270
303
let placement = placements [ i ] ;
271
304
expect ( placement ) . to . have . property ( 'eids' )
272
305
expect ( placement . eids ) . to . be . an ( 'array' )
273
- expect ( placement . eids . length ) . to . be . equal ( 5 )
306
+ expect ( placement . eids . length ) . to . be . equal ( 8 )
274
307
for ( let index in placement . eids ) {
275
308
let v = placement . eids [ index ] ;
276
309
expect ( v ) . to . have . all . keys ( 'source' , 'uids' )
277
- expect ( v . source ) . to . be . oneOf ( [ 'britepool.com ' , 'identityLink ' , 'adserver.org ' , 'id5-sync.com' , 'uidapi.com' ] )
310
+ expect ( v . source ) . to . be . oneOf ( [ 'pubcid.org ' , 'adserver.org ' , 'neustar.biz ' , 'britepool.com' , 'identityLink' , ' id5-sync.com' , 'adserver.org ', 'uidapi.com' ] )
278
311
expect ( v . uids ) . to . be . an ( 'array' ) ;
279
312
expect ( v . uids . length ) . to . be . equal ( 1 )
280
313
expect ( v . uids [ 0 ] ) . to . have . property ( 'id' )
0 commit comments