@@ -40,7 +40,7 @@ const bidRequest = [{
40
40
'bidder' : 'districtmDMX' ,
41
41
'params' : {
42
42
'dmxid' : 100001 ,
43
- 'memberid' : 100003
43
+ 'memberid' : 100003 ,
44
44
} ,
45
45
'adUnitCode' : 'div-gpt-ad-12345678-1' ,
46
46
'transactionId' : 'f6d13fa6-ebc1-41ac-9afa-d8171d22d2c2' ,
@@ -53,6 +53,22 @@ const bidRequest = [{
53
53
'auctionId' : '3d62f2d3-56a2-4991-888e-f7754619ddcf'
54
54
} ] ;
55
55
56
+ const bidRequestNoCoppa = [ {
57
+ 'bidder' : 'districtmDMX' ,
58
+ 'params' : {
59
+ 'dmxid' : 100001 ,
60
+ 'memberid' : 100003
61
+ } ,
62
+ 'adUnitCode' : 'div-gpt-ad-12345678-1' ,
63
+ 'transactionId' : 'f6d13fa6-ebc1-41ac-9afa-d8171d22d2c2' ,
64
+ 'sizes' : [
65
+ [ 300 , 250 ] ,
66
+ [ 300 , 600 ]
67
+ ] ,
68
+ 'bidId' : '29a28a1bbc8a8d' ,
69
+ 'bidderRequestId' : '124b579a136515' ,
70
+ 'auctionId' : '3d62f2d3-56a2-4991-888e-f7754619ddcf'
71
+ } ] ;
56
72
const bidderRequest = {
57
73
'bidderCode' : 'districtmDMX' ,
58
74
'auctionId' : '3d62f2d3-56a2-4991-888e-f7754619ddcf' ,
@@ -61,7 +77,7 @@ const bidderRequest = {
61
77
'bidder' : 'districtmDMX' ,
62
78
'params' : {
63
79
'dmxid' : 100001 ,
64
- 'memberid' : 100003
80
+ 'memberid' : 100003 ,
65
81
} ,
66
82
'adUnitCode' : 'div-gpt-ad-12345678-1' ,
67
83
'transactionId' : 'f6d13fa6-ebc1-41ac-9afa-d8171d22d2c2' ,
@@ -420,6 +436,32 @@ const bidderRequest = {
420
436
'doneCbCallCount' : 0
421
437
} ;
422
438
439
+ const bidderRequestNoCoppa = {
440
+ 'bidderCode' : 'districtmDMX' ,
441
+ 'auctionId' : '3d62f2d3-56a2-4991-888e-f7754619ddcf' ,
442
+ 'bidderRequestId' : '124b579a136515' ,
443
+ 'bids' : [ {
444
+ 'bidder' : 'districtmDMX' ,
445
+ 'params' : {
446
+ 'dmxid' : 100001 ,
447
+ 'memberid' : 100003 ,
448
+ } ,
449
+ 'adUnitCode' : 'div-gpt-ad-12345678-1' ,
450
+ 'transactionId' : 'f6d13fa6-ebc1-41ac-9afa-d8171d22d2c2' ,
451
+ 'sizes' : [
452
+ [ 300 , 250 ] ,
453
+ [ 300 , 600 ]
454
+ ] ,
455
+ 'bidId' : '29a28a1bbc8a8d' ,
456
+ 'bidderRequestId' : '124b579a136515' ,
457
+ 'auctionId' : '3d62f2d3-56a2-4991-888e-f7754619ddcf'
458
+ } ] ,
459
+ 'auctionStart' : 1529511035677 ,
460
+ 'timeout' : 700 ,
461
+ 'start' : 1529511035686 ,
462
+ 'doneCbCallCount' : 0
463
+ } ;
464
+
423
465
const responses = {
424
466
'body' : {
425
467
'id' : '1f45b37c-5298-4934-b517-4d911aadabfd' ,
@@ -522,6 +564,7 @@ describe('DistrictM Adaptor', function () {
522
564
523
565
describe ( `buildRequests test usage` , function ( ) {
524
566
const buildRequestResults = districtm . buildRequests ( bidRequest , bidderRequest ) ;
567
+ const buildRequestResultsNoCoppa = districtm . buildRequests ( bidRequestNoCoppa , bidderRequestNoCoppa ) ;
525
568
it ( `the function should return an array` , function ( ) {
526
569
expect ( buildRequestResults ) . to . be . an ( 'object' ) ;
527
570
} ) ;
@@ -531,6 +574,16 @@ describe('DistrictM Adaptor', function () {
531
574
expect ( bidr . regs . ext . us_privacy ) . to . be . equal ( '1NY' ) ;
532
575
expect ( bidr . user . ext . consent ) . to . be . an ( 'string' ) ;
533
576
} ) ;
577
+ it ( `test contain COPPA` , function ( ) {
578
+ const bidr = JSON . parse ( buildRequestResults . data )
579
+ bidr . regs = bidr . regs || { } ;
580
+ bidr . regs . coppa = 1 ;
581
+ expect ( bidr . regs . coppa ) . to . be . equal ( 1 )
582
+ } )
583
+ it ( `test should not contain COPPA` , function ( ) {
584
+ const bidr = JSON . parse ( buildRequestResultsNoCoppa . data )
585
+ expect ( bidr . regs . coppa ) . to . be . equal ( 0 )
586
+ } )
534
587
it ( `the function should return array length of 1` , function ( ) {
535
588
expect ( buildRequestResults . data ) . to . be . a ( 'string' ) ;
536
589
} ) ;
0 commit comments