-
Notifications
You must be signed in to change notification settings - Fork 628
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
Add initial CustomerSheet
end-to-end tests.
#8525
Add initial CustomerSheet
end-to-end tests.
#8525
Conversation
Diffuse output:
APK
|
993f71c
to
c79c564
Compare
f6e13f5
to
476b725
Compare
85f7289
to
bbf2a42
Compare
) | ||
|
||
state.value = PlaygroundState.Customer(snapshot = snapshot) | ||
customerAdapter.value = adapter |
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.
Storing the adapter
as part of the PlaygroundState
caused the ViewModel
to leak since we store the PlaygroundState
in PlaygroundTestDriver
. Moved it into its own flow.
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.
That's weird. Was the view model holding onto it, or what?
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.
The methods passed into the CustomerAdapter
reference ViewModel
attributes (for example, settings
in order to the update them).
This was a one way to solve. We could instead change the implementation to prefetch ephemeralKey
& setupIntentClientSecret
when preparing CustomerSheet
.
|
||
launchCustomerSheet() | ||
|
||
if (isManagePaymentMethodScreen()) { |
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.
Should we make the individual tests aware of this instead of doing it automatically?
I think we did this approach in payment sheet, but it was mostly to preserve the existing tests passing if I remember right.
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.
Probably yeah. With these initial cases, we shouldn't end up in this screen since we have a new customer. Otherwise, it is a bug. I'll remove the check for now and add it back for SavedPaymentMethod
testing.
) | ||
|
||
state.value = PlaygroundState.Customer(snapshot = snapshot) | ||
customerAdapter.value = adapter |
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.
That's weird. Was the view model holding onto it, or what?
142b059
to
1dd94a6
Compare
1a2816c
to
2b44fc8
Compare
paymentsheet/src/main/java/com/stripe/android/paymentsheet/ui/PaymentElement.kt
Show resolved
Hide resolved
2b44fc8
to
19ea7e6
Compare
19ea7e6
to
169b31e
Compare
Summary
Add initial CustomerSheet end-to-end tests for cards.
Motivation
Ensures card LPM behavior is working end-to-end on Android
Testing