Skip to content

Commit cf95c68

Browse files
authored
Merge pull request Expensify#64618 from nkdengineer/fix/62825
2 parents 9d5f213 + 55c889d commit cf95c68

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/libs/actions/Report.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4267,8 +4267,8 @@ function searchForReports(searchInput: string, policyID?: string) {
42674267
},
42684268
];
42694269

4270-
const searchForRoomToMentionParams: SearchForRoomsToMentionParams = {query: searchInput, policyID};
4271-
const searchForReportsParams: SearchForReportsParams = {searchInput, canCancel: true};
4270+
const searchForRoomToMentionParams: SearchForRoomsToMentionParams = {query: searchInput.toLowerCase(), policyID};
4271+
const searchForReportsParams: SearchForReportsParams = {searchInput: searchInput.toLowerCase(), canCancel: true};
42724272

42734273
// We want to cancel all pending SearchForReports API calls before making another one
42744274
if (!policyID) {

tests/actions/ReportTest.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,4 +1754,14 @@ describe('actions/Report', () => {
17541754
expect(Object.keys(selfDMReportActions ?? {}).length).toBe(3);
17551755
});
17561756
});
1757+
1758+
describe('searchInServer', () => {
1759+
it('should return the same result with or without uppercase input.', () => {
1760+
Report.searchInServer('test');
1761+
Report.searchInServer('TEST');
1762+
const upperCaseRequest = PersistedRequests.getAll().at(0);
1763+
const lowerCaseRequest = PersistedRequests.getAll().at(1);
1764+
expect(upperCaseRequest?.data?.searchInput).toBe(lowerCaseRequest?.data?.searchInput);
1765+
});
1766+
});
17571767
});

0 commit comments

Comments
 (0)