-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Bugfix FXIOS-14575 [Autofill] Credit Card doesn't validate in its last (=expiration) month #31558
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
Conversation
PARAIPAN9
left a comment
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.
Looks Good. Let's see if Bitrise also agrees.
πͺ Quality guardian1 tests files modified. You're a champion of test coverage! π π§Ή Tidy commitJust 2 file(s) touched. Thanks for keeping it clean and review-friendly! π¬ Description craftsmanGreat PR description! Reviewers salute you π«‘ β Per-file coverageAll changed files meet the threshold of 35.0%. Client.app: Coverage: 37.28
Generated by π« Danger Swift against 1153e17 |
| return cardType.validNumberLength.contains(String(card).count) | ||
| } | ||
|
|
||
| func isExpirationValidFor(date: String) -> Bool { |
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 think we should see some tests added in CreditCardValidatorTests ? This logic should be tested
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.
There are some hard-coded ones β would you want me to add one that dynamically tries "this month", too? (Perhaps a few more β a month before this, this one, and the month after I can imagineβ¦)
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.
Yeah a couple of use cases like you said would be perfect!
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.
Would 1153e17 be alright for a test, or it should be more smart, or be mocking some logic?
(I'm never comfortable around testing live values as a form of "moving target" inside tests;D)
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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 @janbrasna ! It's green I'll merge
ee3117e to
1153e17
Compare
|
π PR merged to |
π Tickets
Jira ticket FXIOS-14575
Github issue #31538
π‘ Description
Adding or editing card ending in January should be possible for the whole of January β the card only expires when January ends.
(The first commit used a range to construct the calendar components to represent the validity up to the last second to serve the date comparison, but that turned out too verbose and excessive. The second commit refactored the logic to just number comparison for simplicity and better understandability β while not as cool it seems to actually fit the logic way better, even when boring looking.)
It also simplifies some conditions for comprehension, or removes superfluous ones.
π₯ Demos
π Checklist