-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactor ReimbursementAccountPage's fetchFreePlanVerifiedBankAccount #11751
Conversation
Still need to figure out QA and screenshots from every platform, but this can begin initial review I think and testing |
I don't know what's up with my VM, I'm getting a CORS error when trying to open the VBBA page. Trying to figure out what's causing this so I can test the PR. |
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 code LGTM so far!
I believe we also need to refactor the usage of fetchFreePlanVerifiedBankAccount in the WorkspacePageWithSections component:
App/src/pages/workspace/WorkspacePageWithSections.js
Lines 83 to 86 in 3a5d99b
fetchData() { | |
const achState = lodashGet(this.props.reimbursementAccount, 'achData.state', ''); | |
BankAccounts.fetchFreePlanVerifiedBankAccount('', achState); | |
} |
@youssef-lr Possibly you need to upgrade to PHP8.1? |
@MariaHCD I've already did. I think I'll point App to staging to test this while I figure it out. |
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.
Tested this locally:
- Test a bank account in SETUP: worked as expected
- Test Requestor Step without completing Onfido: worked as expected, except for logging out and logging back in. The personal information form did not have the form data pre-filled
New.Expensify.2.webm
- Test Beneficial Owners Step: worked as expected
- Test PENDING state: haven't tested this yet. We can remove
At the moment, the SO instructions to add a PENDING VBBA is broken
since that bug has been fixed.
This should be ready to go @MariaHCD @nkuoch The only issue to note is, as noted in this bug https://github.com/Expensify/Expensify/issues/238317 . When testing and you sign in for the first time, there will be no VBBA and we will not fetch it at any point until we click "Continue Setup". This means, we won't see the option to continue previous setup or start over |
@@ -58,7 +58,7 @@ function getNextStep(updatedACHData) { | |||
return currentStep; | |||
} | |||
|
|||
if (currentStep === CONST.BANK_ACCOUNT.STEP.VALIDATION && updatedACHData.bankAccountInReview) { |
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.
Did you make sure no other places used bankAccountInReview
?
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.
Oh I need to undo this. We actually removed bankAccountInReview
completely from the web/auth side.
And looking at this page, I don't think this method is used anymore? Its used in setupWithdrawalAccount()
, but that is no longer being used I don't think.
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'm going to undo this change
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.
setupWithdrawalAccount() isn't being used anymore, created an issue to remove this file completely: https://github.com/Expensify/Expensify/issues/240702
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.
Could you also update the Jest unit tests? We're currently using fetchFreePlanVerifiedBankAccount in ReimbursementAccountTest.js
Can we also get rid of tests/unit/fetchFreePlanVerifiedBankAccountTest.js
?
I'm not super familiar with Jest tests. But it seems like it doesn't actually hit an API? If that is the case, is there much to test? We handle so much of it on the php side. |
Ah, good point. We're just mocking the API responses in the Jest tests. And since most of the logic is now in the API, we shouldn't need these tests anymore, correct? |
@ctkochan22 Could you re-fill the PR author checklist? Perhaps it's outdated which is why the test is failing. |
Noticed when testing this that if you log out and then back in again, the forms that you completed before are no longer populated with the data: Screen.Recording.2022-11-08.at.5.46.25.PM.mov |
Woah, this is happening because the path here is incorrect. App/src/libs/ReimbursementAccountUtils.js Line 26 in 4d20ee5
Was that changed recently? |
@youssef-lr Can you test this today please? 🙇 |
@ckscanlon testing now! |
Heads up @youssef-lr, if you run into this error: #11751 (comment) You can test with the Web-E PR: https://github.com/Expensify/Web-Expensify/pull/35506 and it will work |
@ckscanlon after running the query in the last step, this is what I'm seeing, am I missing something? All other tests worked as expected. cc @MariaHCD I think Chris is offline. |
@youssef-lr Is the bank account ending in |
@youssef-lr my bad, the test steps were outdated. Please try the last step when you can! And this PR should be ready to go! |
I'm not sure why this PR didn't have a C+ assigned |
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.
Tested well!
PR Reviewer Checklist
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @youssef-lr in version: 1.2.27-0 🚀
|
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT, | ||
value: { | ||
errors: null, | ||
isLoading: true, |
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.
is it this @ctkochan22 ?
Are we stuck in the isLoading state?
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.
but upon any sort of completion it should be set to false
🚀 Deployed to production by @roryabraham in version: 1.2.27-4 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.2.27-4 🚀
|
@nkuoch @MariaHCD @youssef-lr
Details
This replaces the use of fetchFreePlanVerifiedBankAccount
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/226858
Tests / QA
Test a bank account in SETUP
user_good
andpass_good
to get past plaid)Test Requestor Step without completing Onfido
Test Beneficial Owners Step
Test VERIFYING state
Test PENDING state
PR Review Checklist
PR Author Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Screenshots
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
https://recordit.co/fseVdmCoMz
iOS
https://recordit.co/ygknviefmP
Android