From 2496d6605d68b5b710d249cc25faa5d7b2e43ffa Mon Sep 17 00:00:00 2001 From: Daniel Edwards Date: Mon, 8 May 2023 13:52:57 -0400 Subject: [PATCH 1/2] Fixes tests expectations and adds comments --- tests/unit/OptionsListUtilsTest.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index 1f39d30154fb..ce46ce94f7c7 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -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'); @@ -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're grabbing DM chats and group chats + expect(results.recentReports.length).toBe(5); // When we search for a workspace room results = OptionsListUtils.getShareDestinationOptions(REPORTS_WITH_WORKSPACE_ROOMS, PERSONAL_DETAILS, [], 'Avengers Room'); From 09553e8f1ed9b658a3b8b39ce4c731051c418ed1 Mon Sep 17 00:00:00 2001 From: Daniel Edwards Date: Mon, 8 May 2023 14:10:16 -0400 Subject: [PATCH 2/2] Updated comment --- tests/unit/OptionsListUtilsTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index ce46ce94f7c7..fa3ee0840012 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -651,7 +651,7 @@ 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 - // We should expect 5 recent reports to show because we're grabbing DM chats and group chats + // 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