diff --git a/src/hooks/useSearchSelector.base.ts b/src/hooks/useSearchSelector.base.ts index 2fdd9fd33ee36..2295ba794f5cb 100644 --- a/src/hooks/useSearchSelector.base.ts +++ b/src/hooks/useSearchSelector.base.ts @@ -268,7 +268,6 @@ function useSearchSelectorBase({ searchString: computedSearchTerm, includeUserToInvite, includeCurrentUser, - shouldAcceptName: true, }); default: return getEmptyOptions(); diff --git a/src/libs/OptionsListUtils/index.ts b/src/libs/OptionsListUtils/index.ts index 863979a1513e3..404d7a4d021aa 100644 --- a/src/libs/OptionsListUtils/index.ts +++ b/src/libs/OptionsListUtils/index.ts @@ -2091,7 +2091,6 @@ function getValidOptions( maxElements, includeUserToInvite = false, maxRecentReportElements = undefined, - shouldAcceptName = false, ...config }: GetOptionsConfig = {}, countryCode: number = CONST.DEFAULT_COUNTRY_CODE, @@ -2277,7 +2276,6 @@ function getValidOptions( countryCode, { excludeLogins: loginsToExclude, - shouldAcceptName, }, ); } diff --git a/src/libs/OptionsListUtils/types.ts b/src/libs/OptionsListUtils/types.ts index c8c03f52a864d..c13b856af8bfb 100644 --- a/src/libs/OptionsListUtils/types.ts +++ b/src/libs/OptionsListUtils/types.ts @@ -190,7 +190,6 @@ type GetOptionsConfig = { maxElements?: number; maxRecentReportElements?: number; includeUserToInvite?: boolean; - shouldAcceptName?: boolean; } & GetValidReportsConfig; type GetUserToInviteConfig = { diff --git a/tests/unit/OptionsListUtilsTest.tsx b/tests/unit/OptionsListUtilsTest.tsx index f83ea19250992..c682965fcafad 100644 --- a/tests/unit/OptionsListUtilsTest.tsx +++ b/tests/unit/OptionsListUtilsTest.tsx @@ -1940,28 +1940,6 @@ describe('OptionsListUtils', () => { expect(filteredOptions.userToInvite).toBe(null); }); - it('should not return userToInvite for plain text name when shouldAcceptName is false', () => { - // Given a set of options - const options = getValidOptions({reports: OPTIONS.reports, personalDetails: OPTIONS.personalDetails}, {}, nvpDismissedProductTraining, {includeUserToInvite: true}); - - // When we call filterAndOrderOptions with a plain text name (not email or phone) without shouldAcceptName - const filteredOptions = filterAndOrderOptions(options, 'Jeff Amazon', COUNTRY_CODE, {shouldAcceptName: false}); - - // Then userToInvite should be null since plain names are not accepted by default - expect(filteredOptions?.userToInvite).toBe(null); - }); - - it('should return userToInvite for plain text name when shouldAcceptName is true', () => { - // Given a set of options - const options = getValidOptions({reports: OPTIONS.reports, personalDetails: OPTIONS.personalDetails}, {}, nvpDismissedProductTraining, {includeUserToInvite: true}); - - // When we call filterAndOrderOptions with a plain text name (not email or phone) with shouldAcceptName - const filteredOptions = filterAndOrderOptions(options, 'Jeff', COUNTRY_CODE, {shouldAcceptName: true}); - - // Then userToInvite should be returned for the plain name - expect(filteredOptions?.userToInvite?.text).toBe('jeff'); - }); - it('should not return any options if search value does not match any personal details', () => { // Given a set of options const options = getValidOptions({reports: OPTIONS.reports, personalDetails: OPTIONS.personalDetails}, {}, nvpDismissedProductTraining);