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

Update paypal request #1211

Merged
merged 12 commits into from
Nov 20, 2024
Merged

Conversation

saperi22
Copy link
Contributor

@saperi22 saperi22 commented Nov 15, 2024

Summary of changes

  • Changes for enabling app-switch for one time checkout flow.
  • Added TestParameterInjector for parameterized unit tests. Fewer tests, more coverage.

Checklist

  • Added a changelog entry
  • Relevant test coverage

Authors

List GitHub usernames for everyone who contributed to this pull request.

@saperi22

@@ -19,7 +19,8 @@ cardinal = "2.2.7-5"
navigationSafeArgsGradlePlugin = "2.5.0"
playServices = "19.4.0"
junit = "4.13.2"
robolectric = "4.11.1"
testParameterInjector = "1.18"
robolectric = "4.14-beta-1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

google/TestParameterInjector#5

The 4.14-beta-1 release of Robolectric includes the new RobolectricTestParameterInjector that integrates with TestParameterInjector using the newly exposed APIs in TestParameterInjector 1.18.

@saperi22 saperi22 marked this pull request as ready for review November 18, 2024 21:10
@saperi22 saperi22 requested a review from a team as a code owner November 18, 2024 21:10
assertFalse(request.getHasUserLocationConsent());
}

@Test
public void setsValuesCorrectly() {
public void setsValuesCorrectly(@TestParameter boolean appSwitchEnabled) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not familiar with Robolectric's TestParameter. Will it run the test with a random value? Or run the test multiple times with different values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You'd usually have to provide which values to run.
In this case though, since the value is a boolean, it just runs for false and true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW, to be precise, @TestParameter is from the TestParameterInjector library.
We can't have two @RunWith classes; with 4.14-beta-1 robolectric now supports integration with TestParameterInjector, which IMO, has a better and concise way of doing parameterized tests. Robolectric used to do it differently.

Copy link
Contributor

@jaxdesmarais jaxdesmarais left a comment

Choose a reason for hiding this comment

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

We will also want to change the base branch to the feature branch vs main. If one hasn't been created yet feel free to make it (I think the name is in the ticket).

CHANGELOG.md Outdated
## unreleased

* PayPal
* Add `enablePayPalAppSwitch` property to `PayPalCheckoutRequest`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add an entry similar to what exists in 5.0.0? That way we can more easily indicate this is in beta for the checkout flow as well.

@saperi22 saperi22 changed the base branch from main to app-switch-checkout-feature November 19, 2024 19:00
@saperi22 saperi22 merged commit f4ea668 into app-switch-checkout-feature Nov 20, 2024
3 checks passed
@saperi22 saperi22 deleted the update-paypal-request branch November 20, 2024 16:45
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.

3 participants