@@ -385,9 +385,59 @@ describes.realWin(
385385 'https://server-test-3/' :
386386 '{"consentRequired": true, "consentStateValue": "unknown"}' ,
387387 'https://geo-override-check2/' : '{"consentRequired": true}' ,
388+ 'https://gdpr-applies/' :
389+ '{"consentRequired": true, "gdprApplies": false}' ,
388390 } ;
389391 } ) ;
390392
393+ describe ( 'gdprApplies value' , ( ) => {
394+ it ( 'uses given value' , async ( ) => {
395+ const inlineConfig = {
396+ 'consentInstanceId' : 'abc' ,
397+ 'consentRequired' : 'remote' ,
398+ 'checkConsentHref' : 'https://gdpr-applies/' ,
399+ } ;
400+ ampConsent = getAmpConsent ( doc , inlineConfig ) ;
401+ await ampConsent . buildCallback ( ) ;
402+ await macroTask ( ) ;
403+ const stateManagerGdprApplies = await ampConsent
404+ . getConsentStateManagerForTesting ( )
405+ . getConsentInstanceGdprApplies ( ) ;
406+ expect ( stateManagerGdprApplies ) . to . be . false ;
407+ } ) ;
408+
409+ it ( 'defaults to consentRequired remote value' , async ( ) => {
410+ const inlineConfig = {
411+ 'consentInstanceId' : 'abc' ,
412+ 'consentRequired' : 'remote' ,
413+ 'checkConsentHref' : 'https://geo-override-check2/' ,
414+ } ;
415+ ampConsent = getAmpConsent ( doc , inlineConfig ) ;
416+ await ampConsent . buildCallback ( ) ;
417+ await macroTask ( ) ;
418+ await expect (
419+ ampConsent
420+ . getConsentStateManagerForTesting ( )
421+ . getConsentInstanceGdprApplies ( )
422+ ) . to . eventually . be . true ;
423+ } ) ;
424+
425+ it ( 'never defaults to inline config when checkConsentHref is not defined' , async ( ) => {
426+ const inlineConfig = {
427+ 'consentInstanceId' : 'abc' ,
428+ 'consentRequired' : true ,
429+ } ;
430+ ampConsent = getAmpConsent ( doc , inlineConfig ) ;
431+ await ampConsent . buildCallback ( ) ;
432+ await macroTask ( ) ;
433+ await expect (
434+ ampConsent
435+ . getConsentStateManagerForTesting ( )
436+ . getConsentInstanceGdprApplies ( )
437+ ) . to . eventually . be . null ;
438+ } ) ;
439+ } ) ;
440+
391441 it ( 'should not update local storage when response is false' , async ( ) => {
392442 const inlineConfig = {
393443 'consentInstanceId' : 'abc' ,
@@ -414,7 +464,7 @@ describes.realWin(
414464 } ) ;
415465 } ) ;
416466
417- it ( 'should not update local storage when response is null' , async ( ) => {
467+ it ( 'should not update local storage when consent value response is null' , async ( ) => {
418468 const inlineConfig = {
419469 'consentInstanceId' : 'abc' ,
420470 'consentRequired' : 'remote' ,
0 commit comments