@@ -1324,29 +1324,38 @@ describe('admin.auth', () => {
13241324 enableImprovedEmailPrivacy : true ,
13251325 } ,
13261326 } ;
1327+
1328+ const expectedRecaptchaConfig2 : any = {
1329+ emailPasswordEnforcementState : 'OFF' ,
1330+ phoneEnforcementState : 'OFF' ,
1331+ managedRules : [
1332+ {
1333+ endScore : 0.1 ,
1334+ action : 'BLOCK' ,
1335+ } ,
1336+ ] ,
1337+ smsTollFraudManagedRules : [
1338+ {
1339+ startScore : 0.1 ,
1340+ action : 'BLOCK' ,
1341+ }
1342+ ] ,
1343+ useAccountDefender : false ,
1344+ useSmsBotScore : false ,
1345+ useSmsTollFraudProtection : false ,
1346+ } ;
13271347 const expectedProjectConfig2 : any = {
13281348 smsRegionConfig : smsRegionAllowlistOnlyConfig ,
13291349 multiFactorConfig : mfaSmsEnabledTotpEnabledConfig ,
13301350 passwordPolicyConfig : passwordConfig ,
1331- recaptchaConfig : {
1332- emailPasswordEnforcementState : 'OFF' ,
1333- managedRules : [
1334- {
1335- endScore : 0.1 ,
1336- action : 'BLOCK' ,
1337- } ,
1338- ] ,
1339- useAccountDefender : false ,
1340- useSmsBotScore : false ,
1341- useSmsTollFraudProtection : false ,
1342- } ,
1351+ recaptchaConfig : expectedRecaptchaConfig2 ,
13431352 emailPrivacyConfig : { } ,
13441353 } ;
13451354 const expectedProjectConfigSmsEnabledTotpDisabled : any = {
13461355 smsRegionConfig : smsRegionAllowlistOnlyConfig ,
13471356 multiFactorConfig : mfaSmsEnabledTotpDisabledConfig ,
13481357 passwordPolicyConfig : passwordConfig ,
1349- recaptchaConfig : recaptchaStateOffConfig ,
1358+ recaptchaConfig : expectedRecaptchaConfig2 ,
13501359 emailPrivacyConfig : { } ,
13511360 } ;
13521361
@@ -1359,10 +1368,14 @@ describe('admin.auth', () => {
13591368 return getAuth ( ) . projectConfigManager ( ) . updateProjectConfig ( projectConfigOption2 ) ;
13601369 } )
13611370 . then ( ( actualProjectConfig ) => {
1371+ // Existing keys won't be deleted from the response and generated differently each time.
1372+ delete actualProjectConfig . recaptchaConfig ?. recaptchaKeys ;
13621373 expect ( actualProjectConfig . toJSON ( ) ) . to . deep . equal ( expectedProjectConfig2 ) ;
13631374 return getAuth ( ) . projectConfigManager ( ) . updateProjectConfig ( projectConfigOptionSmsEnabledTotpDisabled ) ;
13641375 } )
13651376 . then ( ( actualProjectConfig ) => {
1377+ // Existing keys won't be deleted from the response and generated differently each time.
1378+ delete actualProjectConfig . recaptchaConfig ?. recaptchaKeys ;
13661379 expect ( actualProjectConfig . toJSON ( ) ) . to . deep . equal ( expectedProjectConfigSmsEnabledTotpDisabled ) ;
13671380 } ) ;
13681381 } ) ;
0 commit comments