-
Notifications
You must be signed in to change notification settings - Fork 991
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
[Enhancement] - User can see Payment Methods screen #367
Conversation
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.
Great job!! Had a few comments.
app/src/main/java/com/kickstarter/ui/activities/PaymentMethodsActivity.kt
Show resolved
Hide resolved
app/src/main/java/com/kickstarter/ui/viewholders/PaymentMethodsViewHolder.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/kickstarter/ui/viewholders/PaymentMethodsViewHolder.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/kickstarter/ui/viewholders/PaymentMethodsViewHolder.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/kickstarter/viewmodels/PaymentMethodsViewHolderViewModel.kt
Show resolved
Hide resolved
|
||
</android.support.design.widget.AppBarLayout> | ||
|
||
<ScrollView |
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.
Hey @dannyalright, we are wondering: should the whole screen scroll under the toolbar or only the list of cards. I'm leaning towards the list so we can always see the "Add a new card" row.
app/src/test/java/com/kickstarter/viewmodels/PaymentMethodsViewModelTest.kt
Show resolved
Hide resolved
} | ||
}).build()) | ||
|
||
this.cards.assertValueCount(1) |
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.
In this test, let's assert the proper list is emitted like this:
@Test
fun testGetCards() {
val node = UserPaymentsQuery.Node("", "5555", Date(), "9876",
CreditCardState.ACTIVE, CreditCardPaymentType.CREDIT_CARD, CreditCardTypes.MASTERCARD)
setUpEnvironment(environment().toBuilder().apolloClient(object : MockApolloClient() {
override fun getStoredCards(): Observable<UserPaymentsQuery.Data> {
return Observable.just(UserPaymentsQuery.Data(UserPaymentsQuery.Me("",
UserPaymentsQuery.StoredCards("", List(1
) { _ -> node }))))
}
}).build())
this.cards.assertValue(Collections.singletonList(node))
}
}
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.
init { | ||
this.card.map { expiration -> expiration.expirationDate() } | ||
.map { | ||
val sdf = SimpleDateFormat("MM/yyyy", Locale.getDefault()) |
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.
Let's make this a private variable so we don't recreate it every time card
emits
app/src/test/java/com/kickstarter/viewmodels/PaymentMethodsViewModelTest.kt
Show resolved
Hide resolved
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.
TO QA 🚀
What
PaymentMethodsViewModel
,PaymentMethodsActivity
,PaymentMethodsViewHolderViewModel
,PaymentMethodsViewHolder
, andPaymentMethodsAdapter
.CreditCardTypes
.PaymentMethodsViewModel
andPaymentMethodsViewHolderViewModel
userpayments.graphql
file for PaymentQueries
andMutations
.CustomTypeAdapter
forDate
.constraint_layout_version
to1.1.3
Story
User can see Payment Methods screen
See 👀