@@ -140,7 +140,7 @@ describe('fwsspBidAdapter', () => {
140140 expect ( actualDataString ) . to . include ( '_fw_player_width=1920' ) ;
141141 expect ( actualDataString ) . to . include ( '_fw_player_height=1080' ) ;
142142 expect ( actualDataString ) . to . include ( '_fw_gdpr_consent=consentString' ) ;
143- expect ( actualDataString ) . to . include ( '_fw_gdpr=true ' ) ;
143+ expect ( actualDataString ) . to . include ( '_fw_gdpr=1 ' ) ;
144144 expect ( actualDataString ) . to . include ( '_fw_us_privacy=uspConsentString' ) ;
145145 expect ( actualDataString ) . to . include ( 'gpp=gppString' ) ;
146146 expect ( actualDataString ) . to . include ( 'gpp_sid=8' ) ;
@@ -159,7 +159,7 @@ describe('fwsspBidAdapter', () => {
159159 const requests = spec . buildRequests ( getBidRequests ( ) , bidderRequest ) ;
160160 expect ( requests ) . to . be . an ( 'array' ) . that . is . not . empty ;
161161 const request = requests [ 0 ] ;
162- const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=on-demand&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_bidfloor=2&_fw_bidfloorcur=EUR&_fw_gdpr_consent=consentString&_fw_gdpr=true &_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&schain=1.0,1!example.com,0,1,bidrequestid,,example.com;tpos=0&ptgt=a&slid=Preroll_1&slau=preroll;` ;
162+ const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=on-demand&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_bidfloor=2&_fw_bidfloorcur=EUR&_fw_gdpr_consent=consentString&_fw_gdpr=1 &_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&schain=1.0,1!example.com,0,1,bidrequestid,,example.com;tpos=0&ptgt=a&slid=Preroll_1&slau=preroll;` ;
163163 const actualUrl = `${ request . url } ?${ request . data } ` ;
164164 // Remove pvrn and vprn from both URLs before comparing
165165 const cleanUrl = ( url ) => url . replace ( / & p v r n = [ ^ & ] * / g, '' ) . replace ( / & v p r n = [ ^ & ] * / g, '' ) ;
@@ -235,7 +235,7 @@ describe('fwsspBidAdapter', () => {
235235 bidRequests [ 0 ] . params . adRequestKeyValues . _fw_is_lat = 1 ;
236236 const requests = spec . buildRequests ( bidRequests , bidderRequest ) ;
237237 const request = requests [ 0 ] ;
238- const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=on-demand&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_coppa=1&_fw_atts=1&_fw_is_lat=1&_fw_bidfloor=2&_fw_bidfloorcur=EUR&_fw_gdpr_consent=consentString&_fw_gdpr=true &_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&schain=1.0,1!example.com,0,1,bidrequestid,,example.com;tpos=0&ptgt=a&slid=Preroll_1&slau=preroll;` ;
238+ const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=on-demand&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_coppa=1&_fw_atts=1&_fw_is_lat=1&_fw_bidfloor=2&_fw_bidfloorcur=EUR&_fw_gdpr_consent=consentString&_fw_gdpr=1 &_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&schain=1.0,1!example.com,0,1,bidrequestid,,example.com;tpos=0&ptgt=a&slid=Preroll_1&slau=preroll;` ;
239239 const actualUrl = `${ request . url } ?${ request . data } ` ;
240240 // Remove pvrn and vprn from both URLs before comparing
241241 const cleanUrl = ( url ) => url . replace ( / & p v r n = [ ^ & ] * / g, '' ) . replace ( / & v p r n = [ ^ & ] * / g, '' ) ;
@@ -268,7 +268,7 @@ describe('fwsspBidAdapter', () => {
268268
269269 const requests = spec . buildRequests ( bidRequests , bidderRequest2 ) ;
270270 const request = requests [ 0 ] ;
271- const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=on-demand&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_coppa=0&_fw_atts=0&_fw_is_lat=0&_fw_bidfloor=2&_fw_bidfloorcur=EUR&_fw_gdpr_consent=consentString&_fw_gdpr=true &_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&schain=1.0,1!example.com,0,1,bidrequestid,,example.com;tpos=0&ptgt=a&slid=Preroll_1&slau=preroll;` ;
271+ const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=on-demand&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_coppa=0&_fw_atts=0&_fw_is_lat=0&_fw_bidfloor=2&_fw_bidfloorcur=EUR&_fw_gdpr_consent=consentString&_fw_gdpr=1 &_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&schain=1.0,1!example.com,0,1,bidrequestid,,example.com;tpos=0&ptgt=a&slid=Preroll_1&slau=preroll;` ;
272272 const actualUrl = `${ request . url } ?${ request . data } ` ;
273273 // Remove pvrn and vprn from both URLs before comparing
274274 const cleanUrl = ( url ) => url . replace ( / & p v r n = [ ^ & ] * / g, '' ) . replace ( / & v p r n = [ ^ & ] * / g, '' ) ;
@@ -475,7 +475,7 @@ describe('fwsspBidAdapter', () => {
475475 expect ( actualDataString ) . to . include ( '_fw_player_width=1920' ) ;
476476 expect ( actualDataString ) . to . include ( '_fw_player_height=1080' ) ;
477477 expect ( actualDataString ) . to . include ( '_fw_gdpr_consent=consentString' ) ;
478- expect ( actualDataString ) . to . include ( '_fw_gdpr=true ' ) ;
478+ expect ( actualDataString ) . to . include ( '_fw_gdpr=1 ' ) ;
479479 expect ( actualDataString ) . to . include ( '_fw_us_privacy=uspConsentString' ) ;
480480 expect ( actualDataString ) . to . include ( 'gpp=gppString' ) ;
481481 expect ( actualDataString ) . to . include ( 'gpp_sid=8' ) ;
@@ -492,12 +492,26 @@ describe('fwsspBidAdapter', () => {
492492 expect ( actualDataString ) . to . include ( expectedEncodedSchainString ) ;
493493 } ) ;
494494
495+ it ( 'should should set _fw_gdpr=0 if gdprApplies is false' , ( ) => {
496+ const bidderRequest2 = {
497+ gdprConsent : {
498+ consentString : 'consentString' ,
499+ gdprApplies : false
500+ }
501+ } ;
502+ const requests = spec . buildRequests ( getBidRequests ( ) , bidderRequest2 ) ;
503+ const request = requests [ 0 ] ;
504+ const actualDataString = request . data ;
505+ expect ( actualDataString ) . to . include ( '_fw_gdpr=0' ) ;
506+ expect ( actualDataString ) . to . include ( '_fw_gdpr_consent=consentString' ) ;
507+ } ) ;
508+
495509 it ( 'should construct the full adrequest URL correctly' , ( ) => {
496510 const requests = spec . buildRequests ( getBidRequests ( ) , bidderRequest ) ;
497511 expect ( requests ) . to . be . an ( 'array' ) . that . is . not . empty ;
498512 const request = requests [ 0 ] ;
499513
500- const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=live&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_bidfloor=2&_fw_bidfloorcur=USD&_fw_gdpr_consent=consentString&_fw_gdpr=true &_fw_gdpr_consented_providers=test_providers&_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&_fw_prebid_content=%7B%22id%22%3A%22test_content_id%22%2C%22title%22%3A%22test_content_title%22%7D&loc=http%3A%2F%2Fwww.test.com&_fw_video_context=&_fw_placement_type=null&_fw_plcmt_type=null&schain=1.0,1!example.com,0,1,bidrequestid,,example.com;tpos=300&ptgt=a&slid=Midroll&slau=midroll&mind=30&maxd=60;` ;
514+ const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=live&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_bidfloor=2&_fw_bidfloorcur=USD&_fw_gdpr_consent=consentString&_fw_gdpr=1 &_fw_gdpr_consented_providers=test_providers&_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&_fw_prebid_content=%7B%22id%22%3A%22test_content_id%22%2C%22title%22%3A%22test_content_title%22%7D&loc=http%3A%2F%2Fwww.test.com&_fw_video_context=&_fw_placement_type=null&_fw_plcmt_type=null&schain=1.0,1!example.com,0,1,bidrequestid,,example.com;tpos=300&ptgt=a&slid=Midroll&slau=midroll&mind=30&maxd=60;` ;
501515 const actualUrl = `${ request . url } ?${ request . data } ` ;
502516 // Remove pvrn and vprn from both URLs before comparing
503517 const cleanUrl = ( url ) => url . replace ( / & p v r n = [ ^ & ] * / g, '' ) . replace ( / & v p r n = [ ^ & ] * / g, '' ) ;
@@ -1310,7 +1324,7 @@ describe('fwsspBidAdapter', () => {
13101324 const requests = spec . buildRequests ( getBidRequests ( ) , bidderRequest ) ;
13111325 expect ( requests ) . to . be . an ( 'array' ) . that . is . not . empty ;
13121326 const request = requests [ 0 ] ;
1313- const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=live&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_bidfloor=2&_fw_bidfloorcur=USD&_fw_gdpr_consent=consentString&_fw_gdpr=true &_fw_gdpr_consented_providers=test_providers&_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&_fw_prebid_content=%7B%22id%22%3A%22test_content_id%22%2C%22title%22%3A%22test_content_title%22%7D&loc=http%3A%2F%2Fwww.test.com&_fw_video_context=&_fw_placement_type=null&_fw_plcmt_type=null;tpos=300&ptgt=a&slid=Midroll&slau=midroll&mind=30&maxd=60;` ;
1327+ const expectedUrl = `https://example.com/ad/g/1?nw=42015&resp=vast4&prof=42015%3Ajs_allinone_profile&csid=js_allinone_demo_site_section&caid=0&flag=%2Bplay%2Bfwssp%2Bemcr%2Bnucr%2Baeti%2Brema%2Bexvt%2Bfwpbjs&mode=live&vclr=js-7.11.0-prebid-${ pbjs . version } ;_fw_player_width=1920&_fw_player_height=1080&_fw_bidfloor=2&_fw_bidfloorcur=USD&_fw_gdpr_consent=consentString&_fw_gdpr=1 &_fw_gdpr_consented_providers=test_providers&_fw_us_privacy=uspConsentString&gpp=gppString&gpp_sid=8&_fw_prebid_content=%7B%22id%22%3A%22test_content_id%22%2C%22title%22%3A%22test_content_title%22%7D&loc=http%3A%2F%2Fwww.test.com&_fw_video_context=&_fw_placement_type=null&_fw_plcmt_type=null;tpos=300&ptgt=a&slid=Midroll&slau=midroll&mind=30&maxd=60;` ;
13141328 const actualUrl = `${ request . url } ?${ request . data } ` ;
13151329 // Remove pvrn and vprn from both URLs before comparing
13161330 const cleanUrl = ( url ) => url . replace ( / & p v r n = [ ^ & ] * / g, '' ) . replace ( / & v p r n = [ ^ & ] * / g, '' ) ;
0 commit comments