Skip to content
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

Merged
merged 4 commits into from Mar 9, 2022
Merged

Recapcha integ test #1599

merged 4 commits into from Mar 9, 2022

Conversation

Xiaoshouzi-gh
Copy link
Contributor

Integration test for UpdateTenant, getProjectConfig, updateProjectConfig on reCAPTCHA config.
Tests ran passed against a real project.

Discussion

  • Read the contribution guidelines (CONTRIBUTING.md).
  • If this has been discussed in an issue, make sure to link to the issue here.
    If not, go file an issue about this before creating a pull request to discuss.

Testing

  • Make sure all existing tests in the repository pass after your change.
  • If you fixed a bug or added a feature, add a new test to cover your code.

API Changes

  • At this time we cannot accept changes that affect the public API. If you'd like to help
    us make Firebase APIs better, please propose your change in an issue so that we
    can discuss it together.

@lahirumaramba
Copy link
Member

@Xiaoshouzi-gh is the BE API ready to test these? If so I can trigger the integration tests on this PR. Thanks!

@Xiaoshouzi-gh
Copy link
Contributor Author

@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.

@lahirumaramba

Copy link
Member

@lahirumaramba lahirumaramba left a 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.

test/integration/auth.spec.ts Outdated Show resolved Hide resolved
test/integration/auth.spec.ts Outdated Show resolved Hide resolved
test/integration/auth.spec.ts Outdated Show resolved Hide resolved
test/integration/auth.spec.ts Outdated Show resolved Hide resolved
test/integration/auth.spec.ts Show resolved Hide resolved
test/integration/auth.spec.ts Outdated Show resolved Hide resolved
test/integration/auth.spec.ts Outdated Show resolved Hide resolved
test/integration/auth.spec.ts Outdated Show resolved Hide resolved
test/integration/auth.spec.ts Outdated Show resolved Hide resolved
@@ -1643,6 +1707,7 @@ describe('admin.auth', () => {
multiFactorConfig: deepCopy(expectedUpdatedTenant2.multiFactorConfig),
// Test clearing of phone numbers.
testPhoneNumbers: null,
recaptchaConfig: deepCopy(expectedUpdatedTenant2.recaptchaConfig),
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@lahirumaramba lahirumaramba left a 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 Show resolved Hide resolved
},
multiFactorConfig: deepCopy(expectedUpdatedTenant2.multiFactorConfig),
// Test clearing of phone numbers.
testPhoneNumbers: null,
Copy link
Member

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 ?

Copy link
Contributor Author

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,
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@Xiaoshouzi-gh Xiaoshouzi-gh merged commit 13810eb into recaptcha Mar 9, 2022
@Xiaoshouzi-gh Xiaoshouzi-gh deleted the recapcha-integ-test branch March 9, 2022 23:40
Xiaoshouzi-gh added a commit that referenced this pull request Mar 2, 2023
* Added integ test for Project Config and Tenants update on reCAPTCHA config
Xiaoshouzi-gh added a commit that referenced this pull request Mar 30, 2023
* Added integ test for Project Config and Tenants update on reCAPTCHA config
Xiaoshouzi-gh added a commit that referenced this pull request Apr 11, 2023
* Added integ test for Project Config and Tenants update on reCAPTCHA config
Xiaoshouzi-gh added a commit that referenced this pull request Apr 12, 2023
* Added integ test for Project Config and Tenants update on reCAPTCHA config
Xiaoshouzi-gh added a commit that referenced this pull request Apr 12, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants