Skip to content

Commit c0fd0c9

Browse files
Revert changed unit test
1 parent f683871 commit c0fd0c9

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

tests/unit/OptionsListUtilsTest.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,12 +1565,18 @@ describe('OptionsListUtils', () => {
15651565
expect(filteredOptions.recentReports.at(0)?.text).toBe('Mr Sinister');
15661566
});
15671567

1568-
it('should include archived chats in options', () => {
1568+
it('should find archived chats', () => {
1569+
const searchText = 'Archived';
1570+
// Given a set of options
1571+
// When we call getSearchOptions with all betas
15691572
const options = getSearchOptions({options: OPTIONS, draftComments: {}, nvpDismissedProductTraining, betas: [CONST.BETAS.ALL]});
1573+
// When we pass the returned options to filterAndOrderOptions with a search value
1574+
const filteredOptions = filterAndOrderOptions(options, searchText, COUNTRY_CODE);
15701575

1571-
const archivedReport = options.recentReports.find((report) => report.reportID === '10');
1572-
expect(archivedReport).toBeDefined();
1573-
expect(!!archivedReport?.private_isArchived).toBe(true);
1576+
// Then only one report should be returned
1577+
expect(filteredOptions.recentReports.length).toBe(1);
1578+
// Then the returned report should match the search text
1579+
expect(!!filteredOptions.recentReports.at(0)?.private_isArchived).toBe(true);
15741580
});
15751581

15761582
it('should filter options by email if dot is skipped in the email', () => {

0 commit comments

Comments
 (0)