Skip to content

Conversation

@janbrasna
Copy link
Contributor

πŸ“œ 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

Before After
Screenshot 2026-01-08 at 4 23 28 Screenshot 2026-01-08 at 4 23 48

πŸ“ Checklist

  • I filled in the ticket numbers and a description of my work
  • I updated the PR name to follow our PR naming guidelines
  • I ensured unit tests pass and wrote tests for new code
  • If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • If needed, I updated documentation and added comments to complex code

@janbrasna janbrasna requested a review from a team as a code owner January 8, 2026 09:48
@janbrasna janbrasna requested a review from PARAIPAN9 January 8, 2026 09:48
Copy link
Collaborator

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

@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Jan 8, 2026

Messages
πŸ“– Project coverage: 38.16%

πŸ’ͺ Quality guardian

1 tests files modified. You're a champion of test coverage! πŸš€

🧹 Tidy commit

Just 2 file(s) touched. Thanks for keeping it clean and review-friendly!

πŸ’¬ Description craftsman

Great PR description! Reviewers salute you 🫑

βœ… Per-file coverage

All changed files meet the threshold of 35.0%.

Client.app: Coverage: 37.28

File Coverage
CreditCardValidator.swift 74.39% βœ…

Generated by 🚫 Danger Swift against 1153e17

return cardType.validNumberLength.contains(String(card).count)
}

func isExpirationValidFor(date: String) -> Bool {
Copy link
Contributor

@lmarceau lmarceau Jan 9, 2026

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

Copy link
Contributor Author

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…)

Copy link
Contributor

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!

Copy link
Contributor Author

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.

Copy link
Contributor

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

@janbrasna janbrasna force-pushed the fix/autofill-cc-exp branch from ee3117e to 1153e17 Compare January 11, 2026 17:57
@lmarceau lmarceau merged commit 41841e0 into mozilla-mobile:main Jan 13, 2026
10 checks passed
@github-actions
Copy link
Contributor

πŸš€ PR merged to main, targeting version: 147.2

@janbrasna janbrasna deleted the fix/autofill-cc-exp branch January 13, 2026 17:57
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.

4 participants