@@ -508,6 +508,46 @@ describe('yieldoneBidAdapter', function () {
508508 expect ( request [ 0 ] . data . uid2id ) . to . equal ( 'uid2_sample' ) ;
509509 } ) ;
510510 } ) ;
511+
512+ describe ( 'GPID' , function ( ) {
513+ it ( 'dont send GPID if undefined' , function ( ) {
514+ const bidRequests = [
515+ {
516+ params : { placementId : '0' } ,
517+ } ,
518+ {
519+ params : { placementId : '1' } ,
520+ ortb2Imp : { } ,
521+ } ,
522+ {
523+ params : { placementId : '2' } ,
524+ ortb2Imp : undefined ,
525+ } ,
526+ {
527+ params : { placementId : '3' } ,
528+ ortb2Imp : { ext : { gpid : undefined , data : { pubadslot : 'aaa' } } } ,
529+ } ,
530+ ] ;
531+ const request = spec . buildRequests ( bidRequests , bidderRequest ) ;
532+ expect ( request [ 0 ] . data ) . to . not . have . property ( 'gpid' ) ;
533+ expect ( request [ 1 ] . data ) . to . not . have . property ( 'gpid' ) ;
534+ expect ( request [ 2 ] . data ) . to . not . have . property ( 'gpid' ) ;
535+ expect ( request [ 3 ] . data ) . to . not . have . property ( 'gpid' ) ;
536+ } ) ;
537+
538+ it ( 'should send GPID if available' , function ( ) {
539+ const bidRequests = [
540+ {
541+ params : { placementId : '0' } ,
542+ ortb2Imp : { ext : { gpid : 'gpid_sample' } } ,
543+ } ,
544+ ] ;
545+ const request = spec . buildRequests ( bidRequests , bidderRequest ) ;
546+ expect ( request [ 0 ] . data . ext ) . to . be . not . null ;
547+ expect ( request [ 0 ] . data ) . to . have . property ( 'gpid' ) ;
548+ expect ( request [ 0 ] . data . gpid ) . to . equal ( 'gpid_sample' ) ;
549+ } ) ;
550+ } ) ;
511551 } ) ;
512552
513553 describe ( 'interpretResponse' , function ( ) {
0 commit comments