@@ -825,6 +825,29 @@ describe('the rubicon adapter', function () {
825
825
} ) ;
826
826
} ) ;
827
827
828
+ describe ( 'GPP Consent' , function ( ) {
829
+ it ( 'should send gpp information if bidderRequest has a value for gppConsent' , function ( ) {
830
+ bidderRequest . gppConsent = {
831
+ gppString : 'consent' ,
832
+ applicableSections : 2
833
+ } ;
834
+ let [ request ] = spec . buildRequests ( bidderRequest . bids , bidderRequest ) ;
835
+ let data = parseQuery ( request . data ) ;
836
+ delete bidderRequest . gppConsent ;
837
+
838
+ expect ( data [ 'gpp' ] ) . to . equal ( 'consent' ) ;
839
+ expect ( data [ 'gpp_sid' ] ) . to . equal ( '2' ) ;
840
+ } ) ;
841
+
842
+ it ( 'should not send gpp information if bidderRequest does not have a value for gppConsent' , function ( ) {
843
+ let [ request ] = spec . buildRequests ( bidderRequest . bids , bidderRequest ) ;
844
+ let data = parseQuery ( request . data ) ;
845
+
846
+ expect ( data [ 'gpp' ] ) . to . equal ( undefined ) ;
847
+ expect ( data [ 'gpp_sid' ] ) . to . equal ( undefined ) ;
848
+ } ) ;
849
+ } ) ;
850
+
828
851
describe ( 'first party data' , function ( ) {
829
852
it ( 'should not have any tg_v or tg_i params if all are undefined' , function ( ) {
830
853
let params = {
@@ -3653,6 +3676,24 @@ describe('the rubicon adapter', function () {
3653
3676
type : 'iframe' , url : `${ emilyUrl } ?gdpr=1&gdpr_consent=foo&us_privacy=1NYN`
3654
3677
} ) ;
3655
3678
} ) ;
3679
+
3680
+ it ( 'should pass gpp params when gppConsent is present' , function ( ) {
3681
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , { } , { } , undefined , {
3682
+ gppString : 'foo' ,
3683
+ applicableSections : [ 2 ]
3684
+ } ) ) . to . deep . equal ( {
3685
+ type : 'iframe' , url : `${ emilyUrl } ?gpp=foo&gpp_sid=2`
3686
+ } ) ;
3687
+ } ) ;
3688
+
3689
+ it ( 'should pass multiple sid\'s when multiple are present' , function ( ) {
3690
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , { } , { } , undefined , {
3691
+ gppString : 'foo' ,
3692
+ applicableSections : [ 2 , 5 ]
3693
+ } ) ) . to . deep . equal ( {
3694
+ type : 'iframe' , url : `${ emilyUrl } ?gpp=foo&gpp_sid=2,5`
3695
+ } ) ;
3696
+ } ) ;
3656
3697
} ) ;
3657
3698
3658
3699
describe ( 'get price granularity' , function ( ) {
0 commit comments