-
Notifications
You must be signed in to change notification settings - Fork 4k
fix: sort and total Search amounts by the sign the row displays #99747
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
Merged
mountiny
merged 12 commits into
Expensify:main
from
callstack-internal:investigate-issue-671897
Sep 10, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2de036d
fix: sort and total Search amounts by the sign the row displays
BartekObudzinski b6a5874
test: assert Amount column sort order puts credits below positive exp…
BartekObudzinski faed17f
docs: describe what the amount helpers do rather than the bug they fix
BartekObudzinski b23ed04
docs: split the amount helper comment into two sentences
BartekObudzinski ce86590
refactor: extract isTransactionFromExpenseReport and require displayA…
BartekObudzinski a2625cb
Merge remote-tracking branch 'origin/main' into investigate-issue-671897
BartekObudzinski ecfdcec
Merge upstream/main into investigate-issue-671897
BartekObudzinski 4969f1f
fix: sort Total per attendee by displayed sign and align the group co…
BartekObudzinski 31ada8c
revert: keep Total per attendee sorting on its rendered calculation
BartekObudzinski ec5eabc
docs: correct the amount field doc and the footer test name
BartekObudzinski 5c85ea0
Merge remote-tracking branch 'upstream/main' into investigate-issue-6…
BartekObudzinski 0e90b49
test: add displayAmount to the SearchActions selection fixture
BartekObudzinski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import type {TransactionGroupListItemType, TransactionReportGroupListItemType} from '@components/Search/SearchList/ListItem/types'; | ||
| import {mapEmptyReportToSelectedEntry} from '@components/Search/selectionBuilders'; | ||
|
|
||
| import CONST from '@src/CONST'; | ||
|
|
||
| import createMock from '../../utils/createMock'; | ||
|
|
||
| describe('selectionBuilders', () => { | ||
| describe('mapEmptyReportToSelectedEntry', () => { | ||
| it('takes displayAmount from the report-signed total for a report row', () => { | ||
| // totalDisplaySpend is already negated for expense reports, so a credit report keeps its negative sign. | ||
| const item = createMock<TransactionReportGroupListItemType>({ | ||
| keyForList: 'report1', | ||
| reportID: 'report1', | ||
| policyID: 'policy1', | ||
| currency: CONST.CURRENCY.USD, | ||
| groupedBy: CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT, | ||
| transactions: [], | ||
| total: 10000, | ||
| totalDisplaySpend: -10000, | ||
| }); | ||
|
|
||
| const [, entry] = mapEmptyReportToSelectedEntry(item); | ||
|
|
||
| expect(entry.displayAmount).toBe(-10000); | ||
| }); | ||
|
|
||
| it('takes displayAmount from the group total for a group row', () => { | ||
| const item = createMock<TransactionGroupListItemType>({ | ||
| keyForList: `${CONST.SEARCH.GROUP_PREFIX}category1`, | ||
| reportID: undefined, | ||
| policyID: 'policy1', | ||
| currency: CONST.CURRENCY.USD, | ||
| transactions: [], | ||
| total: -4000, | ||
| }); | ||
|
|
||
| const [, entry] = mapEmptyReportToSelectedEntry(item); | ||
|
|
||
| expect(entry.displayAmount).toBe(-4000); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.