forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#3925 from Expensify/joe-pin-owed-balances
Treat IOU debts as pinned reports in the LHN
- Loading branch information
Showing
2 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -86,6 +86,19 @@ describe('OptionsListUtils', () => { | |
reportName: 'Silver Surfer', | ||
unreadActionCount: 0, | ||
}, | ||
|
||
// Note: This report has an IOU | ||
9: { | ||
lastVisitedTimestamp: 1610666739302, | ||
lastMessageTimestamp: 1611282168, | ||
isPinned: false, | ||
reportID: 9, | ||
participants: ['[email protected]'], | ||
reportName: 'Mister Sinister', | ||
unreadActionCount: 0, | ||
iouReportID: 100, | ||
hasOutstandingIOU: true, | ||
}, | ||
}; | ||
|
||
// And a set of personalDetails some with existing reports and some without | ||
|
@@ -119,6 +132,10 @@ describe('OptionsListUtils', () => { | |
displayName: 'Captain America', | ||
login: '[email protected]', | ||
}, | ||
'[email protected]': { | ||
displayName: 'Mr Sinister', | ||
login: '[email protected]', | ||
}, | ||
|
||
// These do not exist in reports at all | ||
'[email protected]': { | ||
|
@@ -134,11 +151,11 @@ describe('OptionsListUtils', () => { | |
const REPORTS_WITH_CONCIERGE = { | ||
...REPORTS, | ||
|
||
9: { | ||
10: { | ||
lastVisitedTimestamp: 1610666739302, | ||
lastMessageTimestamp: 1, | ||
isPinned: false, | ||
reportID: 9, | ||
reportID: 10, | ||
participants: ['[email protected]'], | ||
reportName: 'Concierge', | ||
unreadActionCount: 1, | ||
|
@@ -160,6 +177,10 @@ describe('OptionsListUtils', () => { | |
keys: ONYXKEYS, | ||
initialKeyStates: { | ||
[ONYXKEYS.SESSION]: {email: '[email protected]'}, | ||
[`${ONYXKEYS.COLLECTION.REPORT_IOUS}100`]: { | ||
ownerEmail: '[email protected]', | ||
total: '1000', | ||
}, | ||
}, | ||
registerStorageEventListener: () => {}, | ||
}); | ||
|
@@ -404,11 +425,11 @@ describe('OptionsListUtils', () => { | |
...REPORTS, | ||
|
||
// Note: This report has no lastMessageTimestamp but is also pinned | ||
9: { | ||
10: { | ||
lastVisitedTimestamp: 1610666739300, | ||
lastMessageTimestamp: 0, | ||
isPinned: true, | ||
reportID: 9, | ||
reportID: 10, | ||
participants: ['[email protected]'], | ||
reportName: 'Captain Britain', | ||
}, | ||
|
@@ -436,8 +457,11 @@ describe('OptionsListUtils', () => { | |
// And the most recent pinned report is first in the list of reports | ||
expect(results.recentReports[0].login).toBe('[email protected]'); | ||
|
||
// And the third report is the report with a lastMessageTimestamp | ||
expect(results.recentReports[2].login).toBe('[email protected]'); | ||
// And the third report is the report with an IOU debt | ||
expect(results.recentReports[2].login).toBe('[email protected]'); | ||
|
||
// And the fourth report is the report with the lastMessage timestamp | ||
expect(results.recentReports[3].login).toBe('[email protected]'); | ||
}); | ||
|
||
it('getSidebarOptions() with GSD priority mode', () => { | ||
|
@@ -457,5 +481,8 @@ describe('OptionsListUtils', () => { | |
|
||
// And Black Panther is alphabetically the first report and has an unread message | ||
expect(results.recentReports[0].login).toBe('[email protected]'); | ||
|
||
// And Mister Sinister is alphabetically the fifth report and has an IOU debt despite not being pinned | ||
expect(results.recentReports[5].login).toBe('[email protected]'); | ||
}); | ||
}); |