-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recapcha integ test #1599
Recapcha integ test #1599
Conversation
@Xiaoshouzi-gh is the BE API ready to test these? If so I can trigger the integration tests on this PR. Thanks! |
The Prod endpoint is not ready. I used staging endpoint earlier for testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Added a few comments.
@@ -1643,6 +1707,7 @@ describe('admin.auth', () => { | |||
multiFactorConfig: deepCopy(expectedUpdatedTenant2.multiFactorConfig), | |||
// Test clearing of phone numbers. | |||
testPhoneNumbers: null, | |||
recaptchaConfig: deepCopy(expectedUpdatedTenant2.recaptchaConfig), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does updating a config with an undefined
recaptchaConfig
deletes the current config? Do we need to add a test (unit or integration) for this scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. With recaptchaConfig being undefined, the current config will stay unchanged. Added integration test for updateTenants. As of project config, since it's the only config, it got covered by unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM!
Left a couple minor comments.
test/integration/auth.spec.ts
Outdated
}, | ||
multiFactorConfig: deepCopy(expectedUpdatedTenant2.multiFactorConfig), | ||
// Test clearing of phone numbers. | ||
testPhoneNumbers: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this is testing multiple things. Would it make more sense to just limit this test case only for recaptchaConfig: undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept only recaptchaConfig and an extra displayName in the new version so that the request data sent is not empty. Let me know your thought on this.
multiFactorConfig: deepCopy(expectedUpdatedTenant2.multiFactorConfig), | ||
// Test clearing of phone numbers. | ||
testPhoneNumbers: null, | ||
recaptchaConfig: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recaptchaConfig: null
would throw a runtime error, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
* Added integ test for Project Config and Tenants update on reCAPTCHA config
* Added integ test for Project Config and Tenants update on reCAPTCHA config
* Added integ test for Project Config and Tenants update on reCAPTCHA config
* Added integ test for Project Config and Tenants update on reCAPTCHA config
reCAPTCHA support * Defined reCAPTCHA config. (#1574) - Added reCAPTCHA protection states. - Added reCAPTCHA action rule. - Added reCAPTCHA key config. * Create/Update tenant with ReCAPTCHA Config (#1586) * Support reCaptcha config /create update on tenants. - Support create and update tenants with reCaptcha config. - Added reCaptcha unit tests on tenants operations. * Project config - Recaptcha config (#1595) * Recaptcha config changes in project config. - Implemented getProjectConfig. - Implemented updateProjectConfig. - Updated error code. - Add Term of Service consents. * Recapcha integ test (#1599) * Added integ test for Project Config and Tenants update on reCAPTCHA config * Account defender support for reCAPTCHA (#1616) * Support use_account_defender add-on feature for reCAPTCHA config. * Added integration test for account defender feature.
Integration test for UpdateTenant, getProjectConfig, updateProjectConfig on reCAPTCHA config.
Tests ran passed against a real project.
Discussion
If not, go file an issue about this before creating a pull request to discuss.
Testing
API Changes
us make Firebase APIs better, please propose your change in an issue so that we
can discuss it together.