-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[No QA] feat: add unit tests for edit money request and payment via vbba #27609
Conversation
@thesahindia 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] |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
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 general this looks great! I think there is more to cover but I think we can have that in a separate issue and this is good starting point for the coverage. I think ideally we can cover all the payment types, editing in multiple ways etc
@allroundexperts however, I am not sure if the workspace test is actually creating a workspace chat and expense report.
And one thing I would add to this PR is to test the MODIFIEDEXPENSE report action is correctly added to the report and that its message is correct change ....
or set ...
or removed ...
. Could you add that into this PR please?
onyxMethod: Onyx.METHOD.MERGE, | ||
onyxMethod: Onyx.METHOD.SET, | ||
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, | ||
value: transaction, | ||
}, | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
onyxMethod: Onyx.METHOD.SET, | ||
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`, | ||
value: iouReport, | ||
}, | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
onyxMethod: Onyx.METHOD.SET, | ||
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.chatReportID}`, | ||
value: chatReport, | ||
}, |
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 am not 100% sure this is the best practice, but from this it seems fine to me to use SET
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.
MERGE
merges both previous and the new data. In this case however, we're generating new optimistic objects for transaction
, iouReport
and chatReport
. As such, it makes sense to use SET
directly.
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 change caused regression.
Issue -> "IOU - Edited amount for a paid request does not revert to initial amount after closing error message"
tests/actions/IOUTest.js
Outdated
@@ -1372,4 +1373,424 @@ describe('actions/IOU', () => { | |||
); | |||
}); | |||
}); | |||
|
|||
describe('edit requestMoney', () => { |
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.
describe('edit requestMoney', () => { | |
describe('edit money request', () => { |
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.
Handled.
tests/actions/IOUTest.js
Outdated
let chatReport = {}; | ||
|
||
fetch.pause(); | ||
IOU.requestMoney({}, amount, CONST.CURRENCY.USD, '', merchant, RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, 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.
Is this creating an expense report on workspace chat though? It seems like its the same as the iou report above and we cannot use the VBBA payment type for that
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.
It wasn't. I have updated it to create a workspace now.
@allroundexperts are you bale to address the feedback please? Thanks! |
@mountiny This already exists here. I have added another expect statement that would make it more obvious. As far as the messages are concerned, those are generated in the UI itself instead of being stored in the report action. The tests assert on the report actions and ensure that both the old and new comment are accurate. |
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 very much @allroundexperts
✋ 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 https://github.com/mountiny in version: 1.3.90-0 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.90-2 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.91-0 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.91-8 🚀
|
Details
This PR adds unit tests for the Edit money request flow and the payment via ACH flow.
Fixed Issues
$ #26366
PROPOSAL: #26366
Tests
N/A
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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)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
Web
N/A
Mobile Web - Chrome
N/A
Mobile Web - Safari
N/A
Desktop
N/A
iOS
N/A
Android
N/A