Repository navigation
fix negative amount - #51122
fix negative amount#51122
Conversation
|
@hungvu193 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] |
|
Little update: |
|
Got this issue while testing however I can't reproduce it consistently Screen.Recording.2024-10-25.at.14.54.32.mov |
Reviewer Checklist
Screenshots/VideosAndroid: NativeUploading Screen Recording 2024-10-25 at 16.21.10.mov… Android: mWeb ChromeScreen.Recording.2024-10-25.at.16.21.10.moviOS: NativeScreen.Recording.2024-10-25.at.16.02.41.moviOS: mWeb SafariScreen.Recording.2024-10-25.at.16.11.59.movMacOS: Chrome / SafariScreen.Recording.2024-10-25.at.15.20.02.movMacOS: DesktopScreen.Recording.2024-10-25.at.15.26.37.mov |
|
@Nodebrute could we add a jest test so that we make sure this issue doesn't regress in the future? |
|
@Nodebrute friendly bump on this comment. |
|
Will update this in a few hours. |
|
@hungvu193 Can you help me with the tests here, TIA! |
|
How about this? describe('Check valid amout for IOU/Expense request', () => {
test('IOU amount should be positive', () => {
const iouReport = ReportUtils.buildOptimisticIOUReport(1, 2, 100, '1', 'USD');
const iouTransaction = TransactionUtils.buildOptimisticTransaction(100, 'USD', iouReport.reportID);
const iouAmount = TransactionUtils.getAmount(iouTransaction, false, false);
expect(iouAmount).toBeGreaterThan(0);
});
test('Expense amount should be negative', () => {
const expenseReport = ReportUtils.buildOptimisticExpenseReport('212', '123', 100, 122, 'USD');
const expenseTransaction = TransactionUtils.buildOptimisticTransaction(100, 'USD', expenseReport.reportID);
const expenseAmount = TransactionUtils.getAmount(expenseTransaction, true, false);
expect(expenseAmount).toBeLessThan(0);
});
});Result:
Any thoughts? @blimpich |
|
Thanks @hungvu193. |
Looks good to me! Thank you! |
|
@Nodebrute can we add those tests to the PR? |
|
I've added the tests! Thanks again, @hungvu193, for the help. @blimpich, it's all yours now. |
blimpich
left a comment
There was a problem hiding this comment.
Small typo, fix that and we're good to go!
| }); | ||
| }); | ||
|
|
||
| describe('Check valid amout for IOU/Expense request', () => { |
There was a problem hiding this comment.
| describe('Check valid amout for IOU/Expense request', () => { | |
| describe('Check valid amount for IOU/Expense request', () => { |
|
✋ 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/blimpich in version: 9.0.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.56-9 🚀
|


Details
Fixed Issues
$ #49754
PROPOSAL: #49754 (comment)
Tests
[User A] Submit two expenses to User B.
[User A] Hold one of the expenses.
[User B] Go offline.
[User B] Pay the unheld expense.
[User B] Click on the expense preview of the held expense in the main chat.
[User B] Verify the amount in the transaction thread will not be negative.
Offline tests
Same as above
QA Steps
[User A] Submit two expenses to User B.
[User A] Hold one of the expenses.
[User B] Go offline.
[User B] Pay the unheld expense.
[User B] Click on the expense preview of the held expense in the main chat.
[User B] Verify the amount in the transaction thread will not be negative.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2024-10-19.at.9.01.49.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-10-19.at.9.05.10.PM.mov
iOS: Native
Screen.Recording.2024-10-19.at.8.32.45.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-10-19.at.8.30.05.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-10-19.at.8.15.17.PM.mov
MacOS: Desktop
Screen.Recording.2024-10-19.at.8.23.01.PM.mov