@@ -248,6 +248,71 @@ describe('sovrnBidAdapter', function() {
248
248
expect ( data . regs . ext [ 'us_privacy' ] ) . to . equal ( bidderRequest . uspConsent )
249
249
} )
250
250
251
+ it ( 'should send gpp info in OpenRTB 2.6 location when gppConsent defined' , function ( ) {
252
+ const bidderRequest = {
253
+ ...baseBidderRequest ,
254
+ bidderCode : 'sovrn' ,
255
+ auctionId : '1d1a030790a475' ,
256
+ bidderRequestId : '22edbae2733bf6' ,
257
+ timeout : 3000 ,
258
+ gppConsent : {
259
+ gppString : 'gppstring' ,
260
+ applicableSections : [ 8 ]
261
+ } ,
262
+ bids : [ baseBidRequest ]
263
+ }
264
+ const { regs } = JSON . parse ( spec . buildRequests ( [ baseBidRequest ] , bidderRequest ) . data )
265
+ expect ( regs . gpp ) . to . equal ( 'gppstring' )
266
+ expect ( regs . gpp_sid ) . to . be . an ( 'array' )
267
+ expect ( regs . gpp_sid ) . to . include ( 8 )
268
+ } )
269
+
270
+ it ( 'should not send gpp info when gppConsent is not defined' , function ( ) {
271
+ const bidderRequest = {
272
+ ...baseBidderRequest ,
273
+ bidderCode : 'sovrn' ,
274
+ auctionId : '1d1a030790a475' ,
275
+ bidderRequestId : '22edbae2733bf6' ,
276
+ timeout : 3000 ,
277
+ bids : [ baseBidRequest ] ,
278
+ gdprConsent : {
279
+ consentString : 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==' ,
280
+ gdprApplies : true
281
+ } ,
282
+ }
283
+ const { regs } = JSON . parse ( spec . buildRequests ( [ baseBidRequest ] , bidderRequest ) . data )
284
+ expect ( regs . gpp ) . to . be . undefined
285
+ } )
286
+
287
+ it ( 'should send gdpr info even when gppConsent defined' , function ( ) {
288
+ const bidderRequest = {
289
+ ...baseBidderRequest ,
290
+ bidderCode : 'sovrn' ,
291
+ auctionId : '1d1a030790a475' ,
292
+ bidderRequestId : '22edbae2733bf6' ,
293
+ timeout : 3000 ,
294
+ gdprConsent : {
295
+ consentString : 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==' ,
296
+ gdprApplies : true
297
+ } ,
298
+ gppConsent : {
299
+ gppString : 'gppstring' ,
300
+ applicableSections : [ 8 ]
301
+ } ,
302
+ bids : [ baseBidRequest ]
303
+ }
304
+
305
+ const { regs, user } = JSON . parse ( spec . buildRequests ( [ baseBidRequest ] , bidderRequest ) . data )
306
+
307
+ expect ( regs . ext . gdpr ) . to . exist . and . to . be . a ( 'number' )
308
+ expect ( regs . ext . gdpr ) . to . equal ( 1 )
309
+ expect ( user . ext . consent ) . to . exist . and . to . be . a ( 'string' )
310
+ expect ( user . ext . consent ) . to . equal ( bidderRequest . gdprConsent . consentString )
311
+ expect ( regs . gpp ) . to . equal ( 'gppstring' )
312
+ expect ( regs . gpp_sid ) . to . be . an ( 'array' )
313
+ expect ( regs . gpp_sid ) . to . include ( 8 )
314
+ } )
315
+
251
316
it ( 'should add schain if present' , function ( ) {
252
317
const schainRequest = {
253
318
...baseBidRequest ,
0 commit comments