Skip to content

Commit

Permalink
Merge pull request #18600 from infinitered/dan-fixShareDestinationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam authored May 8, 2023
2 parents 54eb7b7 + 09553e8 commit 8f9c7be
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/unit/OptionsListUtilsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,9 @@ describe('OptionsListUtils', () => {
// When we pass an empty search value
let results = OptionsListUtils.getShareDestinationOptions(REPORTS, PERSONAL_DETAILS, [], '');

// Then we should expect 10 recent reports to show because we're grabbing DM chats and group chats
expect(results.recentReports.length).toBe(10);
// Then we should expect 5 recent reports to show because we're grabbing DM chats and group chats
// because we've limited the number of recent reports to 5
expect(results.recentReports.length).toBe(5);

// When we pass a search value that doesn't match the group chat name
results = OptionsListUtils.getShareDestinationOptions(REPORTS, PERSONAL_DETAILS, [], 'mutants');
Expand All @@ -650,7 +651,8 @@ describe('OptionsListUtils', () => {
results = OptionsListUtils.getShareDestinationOptions(REPORTS_WITH_WORKSPACE_ROOMS, PERSONAL_DETAILS, [], '');

// Then we should expect the DMS, the group chats and the workspace room to show
expect(results.recentReports.length).toBe(11);
// We should expect 5 recent reports to show because we've limited the number of recent reports to 5
expect(results.recentReports.length).toBe(5);

// When we search for a workspace room
results = OptionsListUtils.getShareDestinationOptions(REPORTS_WITH_WORKSPACE_ROOMS, PERSONAL_DETAILS, [], 'Avengers Room');
Expand Down

0 comments on commit 8f9c7be

Please sign in to comment.