Skip to content

Commit 0d30b48

Browse files
authored
Merge pull request Expensify#90376 from Expensify/dangrous-revert88752
Revert Expensify#88752
2 parents 56d7b8a + 1c57a15 commit 0d30b48

2 files changed

Lines changed: 1 addition & 45 deletions

File tree

src/libs/SearchUIUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4419,7 +4419,7 @@ function createTypeMenuSections(params: TypeMenuSectionsParams): SearchTypeMenuS
44194419

44204420
const insightsSearchKeys = [
44214421
CONST.SEARCH.SEARCH_KEYS.SPEND_OVER_TIME,
4422-
CONST.SEARCH.SEARCH_KEYS.TOP_SPENDERS,
4422+
...(!isTrackIntentUser ? [CONST.SEARCH.SEARCH_KEYS.TOP_SPENDERS] : []),
44234423
CONST.SEARCH.SEARCH_KEYS.TOP_CATEGORIES,
44244424
CONST.SEARCH.SEARCH_KEYS.TOP_MERCHANTS,
44254425
];

tests/unit/Search/SearchUIUtilsTest.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7045,50 +7045,6 @@ describe('SearchUIUtils', () => {
70457045
expect(allKeys).not.toContain(CONST.SEARCH.SEARCH_KEYS.EXPORT);
70467046
});
70477047

7048-
it('should show top spenders for track-intent users on eligible paid workspace', () => {
7049-
const mockPolicies = {
7050-
policy1: {
7051-
id: 'policy1',
7052-
name: 'Test Policy',
7053-
owner: adminEmail,
7054-
outputCurrency: 'USD',
7055-
isPolicyExpenseChatEnabled: true,
7056-
role: CONST.POLICY.ROLE.ADMIN,
7057-
type: CONST.POLICY.TYPE.TEAM,
7058-
employeeList: {
7059-
[adminEmail]: {
7060-
email: adminEmail,
7061-
role: CONST.POLICY.ROLE.ADMIN,
7062-
submitsTo: approverEmail,
7063-
},
7064-
[approverEmail]: {
7065-
email: approverEmail,
7066-
role: CONST.POLICY.ROLE.USER,
7067-
submitsTo: adminEmail,
7068-
},
7069-
},
7070-
},
7071-
};
7072-
7073-
const sections = SearchUIUtils.createTypeMenuSections({
7074-
currentUserEmail: adminEmail,
7075-
currentUserAccountID: adminAccountID,
7076-
cardFeedsByPolicy: {},
7077-
defaultCardFeed: undefined,
7078-
policies: mockPolicies,
7079-
savedSearches: {},
7080-
isOffline: false,
7081-
defaultExpensifyCard: undefined,
7082-
draftTransactionIDs: [],
7083-
isTrackIntentUser: true,
7084-
});
7085-
7086-
const allMenuItems = sections.flatMap((section) => section.menuItems);
7087-
const allKeys = allMenuItems.map((item) => item.key);
7088-
7089-
expect(allKeys).toContain(CONST.SEARCH.SEARCH_KEYS.TOP_SPENDERS);
7090-
});
7091-
70927048
it('should generate correct routes', () => {
70937049
const menuItems = SearchUIUtils.createTypeMenuSections({
70947050
currentUserEmail: undefined,

0 commit comments

Comments
 (0)