Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
74070db
Add getExpensifyTeamExclusions helper to PolicyUtils
allgandalf Apr 27, 2026
1b86f0a
Add unit tests for getExpensifyTeamExclusions
allgandalf Apr 27, 2026
54657cc
Wire excludeFromSuggestionsOnly into UserSelectPopup
allgandalf Apr 27, 2026
5a1df3e
Add shouldExcludeExpensifyTeamMembers prop to SearchFiltersParticipan…
allgandalf Apr 27, 2026
7e29b29
Enable Expensify team exclusion on advanced From filter page
allgandalf Apr 27, 2026
e54b1d2
Forward excludeFromSuggestionsOnly through getSearchOptions
allgandalf Apr 27, 2026
168f6aa
Apply Expensify team exclusion to inline from: autocomplete
allgandalf Apr 27, 2026
1a0f4ab
Add unit test for from: autocomplete excluding Expensify team
allgandalf Apr 27, 2026
4e79f64
Replace forEach with for…of in PolicyUtils test fixture builder
allgandalf Apr 27, 2026
25f62ce
Type and scope-disable lint rules in autocomplete from: tests
allgandalf Apr 27, 2026
8613527
Merge remote-tracking branch 'upstream/main' into fix-from-filter-acc…
allgandalf May 4, 2026
bc3e895
Gate Expensify team exclusion in UserSelectPopup behind a prop
allgandalf May 4, 2026
8a59c2b
Pass shouldExcludeExpensifyTeamMembers to UserSelectPopup only for th…
allgandalf May 4, 2026
0f113da
Drop unused eslint-disable directives from autocomplete test
allgandalf May 4, 2026
0cbe7af
Merge remote-tracking branch 'upstream/main' into fix-from-filter-acc…
allgandalf May 11, 2026
58b8d50
Gate Expensify team exclusion in UserSelector behind a prop
allgandalf May 11, 2026
c4e4a8c
Pass shouldExcludeExpensifyTeamMembers to UserSelector only for the F…
allgandalf May 11, 2026
c083706
Merge remote-tracking branch 'upstream/main' into fix-from-filter-acc…
allgandalf May 17, 2026
8d02b68
Use session email when computing From exclusions in UserSelector
allgandalf May 18, 2026
22eaf42
Drop redundant useMemo around expensifyTeamExclusions in UserSelector
allgandalf May 18, 2026
ddeeb22
Drop redundant useMemo around expensifyTeamExclusions in SearchFilter…
allgandalf May 18, 2026
ca6b04a
Fold shouldExclude flag into getExpensifyTeamExclusions helper
allgandalf May 18, 2026
d434728
Merge branch 'Expensify:main' into fix-from-filter-account-managers
allgandalf May 18, 2026
aa33909
Merge remote-tracking branch 'upstream/main' into fix-from-filter-acc…
allgandalf May 19, 2026
8d2843b
Add getNonWorkspaceMemberExclusions helper to PolicyUtils
allgandalf May 20, 2026
96a3d2e
Add unit tests for getNonWorkspaceMemberExclusions
allgandalf May 20, 2026
153e732
Remove getExpensifyTeamExclusions helper and tests
allgandalf May 20, 2026
ff23937
Switch UserSelector to workspace-member scoping with free text entry
allgandalf May 20, 2026
6952bb9
Switch SearchFiltersParticipantsSelector to workspace-member scoping
allgandalf May 20, 2026
da15994
Drop shouldExcludeExpensifyTeamMembers pass-through from FilterCompon…
allgandalf May 20, 2026
864e2ee
Apply workspace-member scoping to inline user-filter autocomplete
allgandalf May 20, 2026
a7a9b63
Update autocomplete tests for workspace-member scoping
allgandalf May 20, 2026
abc64f3
Fix lint in getNonWorkspaceMemberExclusions test helper
allgandalf May 20, 2026
4b8e318
Merge remote-tracking branch 'upstream/main' into fix-from-filter-acc…
allgandalf May 20, 2026
8471067
Align FlashList consumer files to upstream/main after merge
allgandalf May 20, 2026
4da9ef0
Reset unrelated upstream files to upstream/main
allgandalf May 20, 2026
d5ed0ad
Hide Expensify team accounts from workspace member scoping
allgandalf May 20, 2026
e05d614
Add tests for Expensify team exclusion in workspace member scoping
allgandalf May 20, 2026
6f10a4c
Merge branch 'main' into fix-from-filter-account-managers
allgandalf May 22, 2026
037d169
Fix cspell unknown-word in getNonWorkspaceMemberExclusions docstring
allgandalf May 22, 2026
88d9754
Replace getNonWorkspaceMemberExclusions with getExpensifyTeamExclusio…
allgandalf May 23, 2026
bcc27c6
Switch UserSelector to getExpensifyTeamExclusions
allgandalf May 23, 2026
bc07bcd
Switch SearchFiltersParticipantsSelector to getExpensifyTeamExclusions
allgandalf May 23, 2026
8282c3a
Switch user-filter autocomplete to getExpensifyTeamExclusions
allgandalf May 23, 2026
be1691c
Update getExpensifyTeamExclusions tests for per-policy filter
allgandalf May 23, 2026
62b8518
Update autocomplete tests for getExpensifyTeamExclusions
allgandalf May 23, 2026
d195a24
Merge branch 'Expensify:main' into fix-from-filter-account-managers
allgandalf May 23, 2026
d4de17f
Merge remote-tracking branch 'upstream/main' into fix-from-filter-acc…
allgandalf May 25, 2026
f897f44
Merge remote-tracking branch 'upstream/main' into fix-from-filter-acc…
allgandalf Jun 1, 2026
c09a637
Merge remote-tracking branch 'upstream/main' into fix-from-filter-acc…
allgandalf Jun 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/Search/FilterComponents/UserSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import {usePersonalDetails} from '@components/OnyxListItemProvider';
import SelectionList from '@components/SelectionList';
import UserSelectionListItem from '@components/SelectionList/ListItem/UserSelectionListItem';
import type {ListItem, SelectionListHandle} from '@components/SelectionList/types';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import usePersonalDetailSearchSelector from '@hooks/usePersonalDetailSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import canFocusInputOnScreenFocus from '@libs/canFocusInputOnScreenFocus';
import type {OptionData} from '@libs/PersonalDetailOptionsListUtils';
import {getExpensifyTeamExclusions} from '@libs/PolicyUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ListFilterWrapper from './ListFilterViewWrapper';
Expand All @@ -23,8 +25,10 @@ function UserSelector({value = [], onChange}: UserSelectorProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const personalDetails = usePersonalDetails();
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const shouldFocusInputOnScreenFocus = canFocusInputOnScreenFocus();
const [isSearchingForReports] = useOnyx(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS);
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const initialSelectedAccountIDs = value.reduce<Set<string>>((acc, id) => {
const participant = personalDetails?.[id];
if (!participant) {
Expand All @@ -35,10 +39,14 @@ function UserSelector({value = [], onChange}: UserSelectorProps) {
return acc;
}, new Set<string>());

const expensifyTeamExclusions = getExpensifyTeamExclusions(personalDetails, policies, currentUserPersonalDetails.email);

const {searchTerm, setSearchTerm, availableOptions, totalOptionsCount, toggleSelection, areOptionsInitialized} = usePersonalDetailSearchSelector({
selectionMode: CONST.SEARCH_SELECTOR.SELECTION_MODE_MULTI,
initialSelected: initialSelectedAccountIDs,
excludeLogins: CONST.EXPENSIFY_EMAILS_OBJECT,
excludeFromSuggestionsOnly: expensifyTeamExclusions,
includeUserToInvite: true,
includeCurrentUser: false,
includeRecentReports: false,
onSelectionChange: onChange,
Expand Down
4 changes: 4 additions & 0 deletions src/components/Search/SearchFiltersParticipantsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import useSearchSelector from '@hooks/useSearchSelector';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
import {formatSectionsFromSearchTerm, getFilteredRecentAttendees, getParticipantsOption} from '@libs/OptionsListUtils';
import {doesPersonalDetailMatchSearchTerm} from '@libs/OptionsListUtils/searchMatchUtils';
import {getExpensifyTeamExclusions} from '@libs/PolicyUtils';
import type {OptionData} from '@libs/ReportUtils';
import {getDisplayNameForParticipant} from '@libs/ReportUtils';
import Navigation from '@navigation/Navigation';
Expand Down Expand Up @@ -77,13 +78,16 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate,
[personalDetails, recentAttendees, currentUserEmail, currentUserAccountID, shouldAllowNameOnlyOptions],
);

const expensifyTeamExclusions = getExpensifyTeamExclusions(personalDetails, allPolicies, currentUserEmail);

const {searchTerm, debouncedSearchTerm, setSearchTerm, availableOptions, selectedOptions, setSelectedOptions, toggleSelection, areOptionsInitialized, onListEndReached} =
useSearchSelector({
selectionMode: CONST.SEARCH_SELECTOR.SELECTION_MODE_MULTI,
searchContext: CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_GENERAL,
maxRecentReportsToShow: CONST.IOU.MAX_RECENT_REPORTS_TO_SHOW,
includeUserToInvite: true,
excludeLogins: CONST.EXPENSIFY_EMAILS_OBJECT,
excludeFromSuggestionsOnly: expensifyTeamExclusions,
includeRecentReports: true,
shouldInitialize: didScreenTransitionEnd,
includeCurrentUser: true,
Expand Down
6 changes: 5 additions & 1 deletion src/hooks/useAutocompleteSuggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {getCardDescription, isCard, isCardHiddenFromSearch} from '@libs/CardUtil
import {getDecodedCategoryName} from '@libs/CategoryUtils';
import type {OptionList} from '@libs/OptionsListUtils';
import {getSearchOptions} from '@libs/OptionsListUtils';
import {getAllTaxRates, getCleanedTagName, shouldShowPolicy} from '@libs/PolicyUtils';
import {getAllTaxRates, getCleanedTagName, getExpensifyTeamExclusions, shouldShowPolicy} from '@libs/PolicyUtils';
import {
getAutocompleteCategories,
getAutocompleteRecentCategories,
Expand Down Expand Up @@ -219,6 +219,9 @@ function useAutocompleteSuggestions({
case CONST.SEARCH.SYNTAX_FILTER_KEYS.PAYER:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.ATTENDEE:
case CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPORTER: {
// Soft-exclude Expensify-team logins (current and former AMs/Guides) from user filter suggestions. Users can still type any email manually because the search bar accepts free text.
const memberExclusions = getExpensifyTeamExclusions(personalDetails, policies, currentUserEmail);

const participants = getSearchOptions({
options,
draftComments,
Expand All @@ -240,6 +243,7 @@ function useAutocompleteSuggestions({
personalDetails,
sortedActions,
conciergeReportID,
excludeFromSuggestionsOnly: memberExclusions,
}).options.personalDetails.filter((participant) => participant.text && !alreadyAutocompletedKeys.has(participant.text.toLowerCase()));

return participants.map((participant) => ({
Expand Down
3 changes: 3 additions & 0 deletions src/libs/OptionsListUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2701,6 +2701,7 @@ type SearchOptionsConfig = {
allPolicyTags?: OnyxCollection<PolicyTagLists>;
sortedActions: Record<string, ReportAction[]> | undefined;
conciergeReportID: string | undefined;
excludeFromSuggestionsOnly?: Record<string, boolean>;
};

/**
Expand Down Expand Up @@ -2730,6 +2731,7 @@ function getSearchOptions({
allPolicyTags,
sortedActions,
conciergeReportID,
excludeFromSuggestionsOnly = {},
}: SearchOptionsConfig): OptionsResult {
const optionList = getValidOptions(options, policyCollection, draftComments, loginList, currentUserAccountID, currentUserEmail, conciergeReportID, {
betas,
Expand Down Expand Up @@ -2757,6 +2759,7 @@ function getSearchOptions({
reportAttributesDerived,
allPolicyTags,
sortedActions,
excludeFromSuggestionsOnly,
});

return optionList;
Expand Down
45 changes: 45 additions & 0 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,50 @@ function getGuideAndAccountManagerInfo(
};
}

/**
* Build a soft-exclusion map of Expensify-team logins (current and former AMs/Guides) so search
* filters don't surface internal Expensify staff to customers. Mirrors the visibility rule used
* by WorkspaceMembersPage: skip the filter when the current user is themselves Expensify staff,
* and preserve Expensify-team members of any Expensify-owned policy the current user belongs to.
*/
function getExpensifyTeamExclusions(personalDetails: OnyxEntry<PersonalDetailsList>, policies: OnyxCollection<Policy>, currentUserLogin: string | undefined): Record<string, boolean> {
if (!currentUserLogin || isExpensifyTeam(currentUserLogin)) {
return {};
}

const lowerCurrentUserLogin = currentUserLogin.toLowerCase();
const allowedExpensifyTeamLogins = new Set<string>();

for (const policy of Object.values(policies ?? {})) {
if (!policy?.owner || !policy.employeeList || !isExpensifyTeam(policy.owner)) {
continue;
}
const currentUserIsInPolicy = Object.keys(policy.employeeList).some((email) => email.toLowerCase() === lowerCurrentUserLogin);
if (!currentUserIsInPolicy) {
continue;
}
for (const email of Object.keys(policy.employeeList)) {
const lowerEmail = email.toLowerCase();
if (isExpensifyTeam(lowerEmail)) {
allowedExpensifyTeamLogins.add(lowerEmail);
}
}
}

const exclusion: Record<string, boolean> = {};
for (const details of Object.values(personalDetails ?? {})) {
const login = details?.login?.toLowerCase();
if (!login || !isExpensifyTeam(login)) {
continue;
}
if (allowedExpensifyTeamLogins.has(login)) {
continue;
}
exclusion[login] = true;
}
return exclusion;
}

/**
* Get soft exclusions (Guide/Account Manager) that should be hidden from auto-suggestions
* but can still be manually entered by the user.
Expand Down Expand Up @@ -2339,6 +2383,7 @@ export {
getMemberAccountIDsForWorkspace,
getGuideAndAccountManagerInfo,
getSoftExclusionsForGuideAndAccountManager,
getExpensifyTeamExclusions,
filterGuideAndAccountManager,
isMultiLevelTags,
getPolicyBrickRoadIndicatorStatus,
Expand Down
85 changes: 85 additions & 0 deletions tests/unit/PolicyUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
getCustomUnitsForDuplication,
getDefaultTimeTrackingRate,
getEligibleBankAccountShareRecipients,
getExpensifyTeamExclusions,
getManagerAccountID,
getPolicyEmployeeAccountIDs,
getQBOVendorByID,
Expand Down Expand Up @@ -2694,6 +2695,90 @@ describe('PolicyUtils', () => {
});
});

describe('getExpensifyTeamExclusions', () => {
const buildPersonalDetails = (logins: string[]): PersonalDetailsList => {
const result: PersonalDetailsList = {};
for (const [index, login] of logins.entries()) {
const accountID = index + 1;
result[accountID] = {accountID, login};
}
return result;
};
const buildPolicies = (
specs: Array<{
owner: string;
employeeLogins: string[];
}>,
): OnyxCollection<Policy> => {
const result: OnyxCollection<Policy> = {};
for (const [index, {owner, employeeLogins}] of specs.entries()) {
const memberList: PolicyEmployeeList = {};
for (const login of employeeLogins) {
memberList[login] = {email: login};
}
result[`policy_${index + 1}`] = {id: `${index + 1}`, owner, employeeList: memberList} as Policy;
}
return result;
};

it('returns empty when currentUserLogin is undefined', () => {
const details = buildPersonalDetails(['am@expensify.com', 'bob@acme.com']);
const policies = buildPolicies([{owner: 'customer@acme.com', employeeLogins: ['bob@acme.com']}]);
expect(getExpensifyTeamExclusions(details, policies, undefined)).toEqual({});
});

it('returns empty when currentUserLogin is on the Expensify team (exception)', () => {
const details = buildPersonalDetails(['am@expensify.com', 'bob@acme.com']);
const policies = buildPolicies([{owner: 'customer@acme.com', employeeLogins: ['am@expensify.com', 'bob@acme.com']}]);
expect(getExpensifyTeamExclusions(details, policies, 'staff@expensify.com')).toEqual({});
});

it('excludes all Expensify-team logins from personalDetails when current user is non-Expensify and has no Expensify-owned policies', () => {
const details = buildPersonalDetails(['am@expensify.com', 'guide@team.expensify.com', 'bob@acme.com']);
const policies = buildPolicies([{owner: 'customer@acme.com', employeeLogins: ['bob@acme.com']}]);
const result = getExpensifyTeamExclusions(details, policies, 'customer@acme.com');
expect(result['am@expensify.com']).toBe(true);
expect(result['guide@team.expensify.com']).toBe(true);
expect(result['bob@acme.com']).toBeUndefined();
});

it('preserves Expensify-team members of an Expensify-owned policy the current user belongs to', () => {
const details = buildPersonalDetails(['lead@expensify.com', 'unrelated_am@expensify.com', 'contractor@acme.com']);
const policies = buildPolicies([{owner: 'lead@expensify.com', employeeLogins: ['contractor@acme.com', 'lead@expensify.com']}]);
const result = getExpensifyTeamExclusions(details, policies, 'contractor@acme.com');
expect(result['lead@expensify.com']).toBeUndefined();
expect(result['unrelated_am@expensify.com']).toBe(true);
expect(result['contractor@acme.com']).toBeUndefined();
});

it('does not preserve Expensify-team members of policies the current user is not in', () => {
const details = buildPersonalDetails(['lead@expensify.com', 'bob@acme.com']);
const policies = buildPolicies([{owner: 'lead@expensify.com', employeeLogins: ['lead@expensify.com', 'someone_else@acme.com']}]);
const result = getExpensifyTeamExclusions(details, policies, 'bob@acme.com');
expect(result['lead@expensify.com']).toBe(true);
});

it('does not preserve when policy owner is non-Expensify', () => {
const details = buildPersonalDetails(['am@expensify.com', 'bob@acme.com']);
const policies = buildPolicies([{owner: 'bob@acme.com', employeeLogins: ['am@expensify.com', 'bob@acme.com']}]);
const result = getExpensifyTeamExclusions(details, policies, 'bob@acme.com');
expect(result['am@expensify.com']).toBe(true);
});

it('handles undefined and empty inputs gracefully', () => {
expect(getExpensifyTeamExclusions(undefined, undefined, 'customer@acme.com')).toEqual({});
expect(getExpensifyTeamExclusions(null as unknown as OnyxEntry<PersonalDetailsList>, null as unknown as OnyxCollection<Policy>, 'customer@acme.com')).toEqual({});
expect(getExpensifyTeamExclusions({}, {}, 'customer@acme.com')).toEqual({});
});

it('lowercases comparison keys for current user and employeeList matching', () => {
const details = buildPersonalDetails(['AM@expensify.com', 'Bob@Acme.com']);
const policies = buildPolicies([{owner: 'lead@expensify.com', employeeLogins: ['AM@expensify.com', 'Contractor@Acme.com']}]);
const result = getExpensifyTeamExclusions(details, policies, 'Contractor@Acme.com');
expect(result['am@expensify.com']).toBeUndefined();
expect(result['bob@acme.com']).toBeUndefined();
});
});
describe('canAccessSubmitWorkspaceFeatures', () => {
const submitPolicyForAccessTest: Policy = {...createRandomPolicy(99001, CONST.POLICY.TYPE.SUBMIT), id: 'policy-submit-access-test'};
const teamPolicyForAccessTest: Policy = {...createRandomPolicy(99002, CONST.POLICY.TYPE.TEAM), id: 'policy-team-access-test'};
Expand Down
75 changes: 75 additions & 0 deletions tests/unit/hooks/useAutocompleteSuggestions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jest.mock('@libs/PolicyUtils', () => ({
getAllTaxRates: jest.fn(() => ({})),
getCleanedTagName: jest.fn((tag: string) => tag),
shouldShowPolicy: jest.fn(() => true),
getExpensifyTeamExclusions: jest.fn(() => ({})),
}));

jest.mock('@libs/CardFeedUtils', () => ({
Expand Down Expand Up @@ -92,6 +93,8 @@ jest.mock('@hooks/useExportedToFilterOptions', () => ({
}));

const {parseForAutocomplete} = jest.requireMock<{parseForAutocomplete: jest.Mock}>('@libs/SearchAutocompleteUtils');
const {getSearchOptions} = jest.requireMock<{getSearchOptions: jest.Mock}>('@libs/OptionsListUtils');
const {getExpensifyTeamExclusions} = jest.requireMock<{getExpensifyTeamExclusions: jest.Mock}>('@libs/PolicyUtils');

const defaultParams = {
autocompleteQueryValue: '',
Expand Down Expand Up @@ -359,6 +362,78 @@ describe('useAutocompleteSuggestions', () => {
expect(result.current.at(0)?.text).toBe('Test Workspace');
});

/* eslint-disable @typescript-eslint/naming-convention -- test fixtures use accountID-keyed maps and email-keyed exclusion records */
describe('Expensify team exclusions on user-filter autocomplete', () => {
const personalDetailsWithMix = {
'1': {accountID: 1, login: 'am@expensify.com'},
'2': {accountID: 2, login: 'guide@team.expensify.com'},
'3': {accountID: 3, login: 'customer@acme.com'},
};

const lastSearchOptionsCallExclusions = (): Record<string, boolean> | undefined => {
const calls = getSearchOptions.mock.calls as Array<[{excludeFromSuggestionsOnly?: Record<string, boolean>}]>;
return calls.at(-1)?.[0]?.excludeFromSuggestionsOnly;
};

it('passes Expensify-team exclusions to getSearchOptions for from: autocomplete', () => {
parseForAutocomplete.mockReturnValue({
autocomplete: {key: CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM, value: ''},
ranges: [],
});
getExpensifyTeamExclusions.mockReturnValue({'am@expensify.com': true, 'guide@team.expensify.com': true});

renderHook(() =>
useAutocompleteSuggestions({
...defaultParams,
autocompleteQueryValue: 'from:',
currentUserEmail: 'customer@acme.com',
personalDetails: personalDetailsWithMix,
}),
);

expect(lastSearchOptionsCallExclusions()).toEqual({'am@expensify.com': true, 'guide@team.expensify.com': true});
});

it('passes Expensify-team exclusions to getSearchOptions for to: autocomplete as well', () => {
parseForAutocomplete.mockReturnValue({
autocomplete: {key: CONST.SEARCH.SYNTAX_FILTER_KEYS.TO, value: ''},
ranges: [],
});
getExpensifyTeamExclusions.mockReturnValue({'am@expensify.com': true});

renderHook(() =>
useAutocompleteSuggestions({
...defaultParams,
autocompleteQueryValue: 'to:',
currentUserEmail: 'customer@acme.com',
personalDetails: personalDetailsWithMix,
}),
);

expect(lastSearchOptionsCallExclusions()).toEqual({'am@expensify.com': true});
});

it('passes an empty exclusion map when the helper returns nothing', () => {
parseForAutocomplete.mockReturnValue({
autocomplete: {key: CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM, value: ''},
ranges: [],
});
getExpensifyTeamExclusions.mockReturnValue({});

renderHook(() =>
useAutocompleteSuggestions({
...defaultParams,
autocompleteQueryValue: 'from:',
currentUserEmail: 'customer@acme.com',
personalDetails: personalDetailsWithMix,
}),
);

expect(lastSearchOptionsCallExclusions()).toEqual({});
});
});
/* eslint-enable @typescript-eslint/naming-convention */

describe('withdrawal-status autocomplete', () => {
it('returns all three settlement statuses when value is empty', () => {
parseForAutocomplete.mockReturnValue({
Expand Down
Loading