-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Payment card / Subscription] Integrate failed billing scenarios banner with backend data #44072
[Payment card / Subscription] Integrate failed billing scenarios banner with backend data #44072
Conversation
@neil-marcellini Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@MrMuzyk PR updated! |
src/pages/settings/Subscription/CardSection/BillingBanner/BillingBanner.tsx
Show resolved
Hide resolved
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari// 1. Policy owner with amount owed, within grace period // 2. Policy owner with amount owed, overdue (past grace period) // 3. Owner of policy under invoicing, within grace period // 4. Owner of policy under invoicing, overdue (past grace period) // 5. Billing disputed by cardholder // 6. Card not authenticated // 7. Insufficient funds // 8. Card expired // 9. Card due to expire soon // 10. Retry billing success // 11. Retry billing error |
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.
One small nitpick, otherwise looks good.
tests/unit/CardsSectionUtilsTest.ts
Outdated
|
||
describe('CardSectionUtils', () => { | ||
afterEach(() => { | ||
jest.clearAllMocks(); |
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.
Can we use jest.restoreAllMocks
instead of jest.clearAllMocks
? The reason is because restoreAllMocks
is the most powerful of the three functions used to cleanup unit test mocks. clearAllMocks
doesn't restore mock implementations between unit tests, which could lead to the unit tests changing the behavior of subsequent tests due based on the mock implementations of previous tests. restoreAllMocks
makes each individual test much more sandboxed, which is good. See SO for differences.
Looks like we have a merge conflict. @JKobrynski can you address that? |
@blimpich change applied, conflicts resolved |
🚀 Deployed to staging by https://github.com/blimpich in version: 9.0.4-0 🚀
|
🚀 Cherry-picked to staging by https://github.com/tgolen in version: 9.0.4-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
This looks like it's causing some flakey tests - #45340 - let me know if you have ideas! |
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
* @returns Whether there is a subscription green dot info. | ||
*/ | ||
function hasSubscriptionGreenDotInfo(): boolean { | ||
return !getSubscriptionStatus()?.isError ?? false; |
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.
This condition cause a regression here. We had to update the condition.
Part of this issue was caused by this PR. |
Details
Prepare account for testing:
Sign up for an account on staging.expensify.com, go to Settings > Workspaces > New Workspace. Create a Collect workspace.
To access this newly created component, paste the following link into the browser
https://dev.new.expensify.com:8082/settings/subscription
or add this effect to InitialSettingsPage.tsx
Fixed Issues
$ #42431
PROPOSAL: N/A
Tests
src/pages/settings/Subscription/CardSection/utils.ts
file to to return a specific variant and check if the app displays the correct bannerLooking at the first case:
copy the
return
and paste it over theswitch
block to return by default:Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop