diff --git a/src/CONST/index.ts b/src/CONST/index.ts index e8d303b1b8e18..c1ca84a78c200 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -7619,6 +7619,7 @@ const CONST = { STATEMENTS: 'statements', UNAPPROVED_CASH: 'unapprovedCash', UNAPPROVED_CARD: 'unapprovedCard', + EXPENSIFY_CARD: 'expensifyCard', RECONCILIATION: 'reconciliation', TOP_SPENDERS: 'topSpenders', TOP_CATEGORIES: 'topCategories', diff --git a/src/hooks/useSearchShouldCalculateTotals.ts b/src/hooks/useSearchShouldCalculateTotals.ts index 9909daacd16eb..f5400064df62e 100644 --- a/src/hooks/useSearchShouldCalculateTotals.ts +++ b/src/hooks/useSearchShouldCalculateTotals.ts @@ -24,6 +24,7 @@ function useSearchShouldCalculateTotals(searchKey: SearchKey | undefined, search CONST.SEARCH.SEARCH_KEYS.STATEMENTS, CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH, CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD, + CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD, CONST.SEARCH.SEARCH_KEYS.RECONCILIATION, ]; diff --git a/src/languages/de.ts b/src/languages/de.ts index 2a8b251db17b1..d778f889e9df7 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -7099,6 +7099,8 @@ Fordern Sie Spesendetails wie Belege und Beschreibungen an, legen Sie Limits und groupColumns: 'Spalten gruppieren', expenseColumns: 'Spalten für Ausgaben', statements: 'Abrechnungen', + cardStatements: 'Kartenabrechnungen', + monthlyAccrual: 'Monatliche Abgrenzung', unapprovedCash: 'Nicht genehmigtes Bargeld', unapprovedCard: 'Nicht genehmigte Karte', reconciliation: 'Abstimmung', diff --git a/src/languages/en.ts b/src/languages/en.ts index d5c0aeb138f6e..7899168700346 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -7050,6 +7050,8 @@ const translations = { groupColumns: 'Group columns', expenseColumns: 'Expense Columns', statements: 'Statements', + cardStatements: 'Card statements', + monthlyAccrual: 'Monthly accrual', unapprovedCash: 'Unapproved cash', unapprovedCard: 'Unapproved card', reconciliation: 'Reconciliation', diff --git a/src/languages/es.ts b/src/languages/es.ts index dede4ccad19e0..a023a2e6eaf0b 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -6907,6 +6907,8 @@ ${amount} para ${merchant} - ${date}`, groupColumns: 'Columnas de grupo', expenseColumns: 'Columnas de gastos', statements: 'Extractos', + cardStatements: 'Extractos de tarjeta', + monthlyAccrual: 'Devengo mensual', unapprovedCash: 'Efectivo no aprobado', unapprovedCard: 'Tarjeta no aprobada', reconciliation: 'Conciliación', diff --git a/src/languages/fr.ts b/src/languages/fr.ts index 624014061be15..08bbe2421c10d 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -7120,6 +7120,8 @@ Rendez obligatoires des informations de dépense comme les reçus et les descrip groupColumns: 'Regrouper les colonnes', expenseColumns: 'Colonnes de dépenses', statements: 'Relevés', + cardStatements: 'Relevés de carte', + monthlyAccrual: 'Régularisation mensuelle', unapprovedCash: 'Espèces non approuvées', unapprovedCard: 'Carte non approuvée', reconciliation: 'Rapprochement', diff --git a/src/languages/it.ts b/src/languages/it.ts index 16f35a7e1ba35..31a87174644ae 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -7085,6 +7085,8 @@ Richiedi dettagli sulle spese come ricevute e descrizioni, imposta limiti e valo groupColumns: 'Raggruppa colonne', expenseColumns: 'Colonne spese', statements: 'Estratti conto', + cardStatements: 'Estratti carta', + monthlyAccrual: 'Rateo mensile', unapprovedCash: 'Contanti non approvati', unapprovedCard: 'Carta non approvata', reconciliation: 'Riconciliazione', diff --git a/src/languages/ja.ts b/src/languages/ja.ts index aa873fba0bb70..079d43fe03139 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -7012,6 +7012,8 @@ ${reportName} groupColumns: '列をグループ化', expenseColumns: '経費列', statements: 'ステートメント', + cardStatements: 'カード明細', + monthlyAccrual: '月次発生', unapprovedCash: '未承認の現金', unapprovedCard: '未承認のカード', reconciliation: '照合', diff --git a/src/languages/nl.ts b/src/languages/nl.ts index d064fdd6e68d9..ae33b4db2b4ef 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -7064,6 +7064,8 @@ Vereis onkostendetails zoals bonnen en beschrijvingen, stel limieten en standaar groupColumns: 'Kolommen groeperen', expenseColumns: 'Onkostencolommen', statements: 'Afschriften', + cardStatements: 'Kaartafschriften', + monthlyAccrual: 'Maandelijkse opbouw', unapprovedCash: 'Niet-goedgekeurde contante uitgaven', unapprovedCard: 'Niet-goedgekeurde kaart', reconciliation: 'Afstemming', diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 26711f3d65a54..29169b672e0f7 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -7052,6 +7052,8 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i groupColumns: 'Grupuj kolumny', expenseColumns: 'Kolumny wydatków', statements: 'Wyciągi', + cardStatements: 'Wyciągi kartowe', + monthlyAccrual: 'Miesięczne rozliczenie', unapprovedCash: 'Niezaakceptowana gotówka', unapprovedCard: 'Niezaakceptowana karta', reconciliation: 'Uzgodnienie', diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index fa25aaeefb9e5..264eb5ea4f4e1 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -7056,6 +7056,8 @@ Exija dados de despesas como recibos e descrições, defina limites e padrões e groupColumns: 'Agrupar colunas', expenseColumns: 'Colunas de despesas', statements: 'Extratos', + cardStatements: 'Extratos de cartão', + monthlyAccrual: 'Acréscimo mensal', unapprovedCash: 'Dinheiro não aprovado', unapprovedCard: 'Cartão não aprovado', reconciliation: 'Conciliação', diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index d9b83ec742c8e..1ae244ead76aa 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -6900,6 +6900,8 @@ ${reportName} groupColumns: '分组列', expenseColumns: '报销列', statements: '对账单', + cardStatements: '卡对账单', + monthlyAccrual: '月度计提', unapprovedCash: '未批准现金', unapprovedCard: '未批准的卡片', reconciliation: '对账', diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts index 9e143fbef6aae..1984be8c72c7f 100644 --- a/src/libs/SearchQueryUtils.ts +++ b/src/libs/SearchQueryUtils.ts @@ -354,7 +354,7 @@ function getQueryHashes(query: SearchQueryJSON): {primaryHash: number; recentSea // Certain filters' values are significant in deciding which search we are on, so we want to include // their value when computing the similarSearchHash - const similarSearchValueBasedFilters = new Set([CONST.SEARCH.SYNTAX_FILTER_KEYS.ACTION]); + const similarSearchValueBasedFilters = new Set([CONST.SEARCH.SYNTAX_FILTER_KEYS.ACTION, CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE]); const flatFilters = query.flatFilters .map((filter) => { diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 50df8490b6dc2..6ee5c753a2eda 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -682,7 +682,7 @@ function getSuggestedSearches( }, [CONST.SEARCH.SEARCH_KEYS.STATEMENTS]: { key: CONST.SEARCH.SEARCH_KEYS.STATEMENTS, - translationPath: 'search.statements', + translationPath: 'search.cardStatements', type: CONST.SEARCH.DATA_TYPES.EXPENSE, icon: 'CreditCard', searchQuery: buildQueryStringFromFilterFormValues({ @@ -743,17 +743,52 @@ function getSuggestedSearches( return this.searchQueryJSON?.similarSearchHash ?? CONST.DEFAULT_NUMBER_ID; }, }, + [CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD]: { + key: CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD, + translationPath: 'workspace.common.expensifyCard', + type: CONST.SEARCH.DATA_TYPES.EXPENSE, + icon: 'CreditCard', + searchQuery: buildQueryStringFromFilterFormValues( + { + type: CONST.SEARCH.DATA_TYPES.EXPENSE, + withdrawalType: CONST.SEARCH.WITHDRAWAL_TYPE.EXPENSIFY_CARD, + withdrawnOn: CONST.SEARCH.DATE_PRESETS.LAST_MONTH, + groupBy: CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID, + view: CONST.SEARCH.VIEW.TABLE, + }, + { + sortBy: CONST.SEARCH.TABLE_COLUMNS.GROUP_WITHDRAWN, + sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + }, + ), + get searchQueryJSON() { + return buildSearchQueryJSON(this.searchQuery); + }, + get hash() { + return this.searchQueryJSON?.hash ?? CONST.DEFAULT_NUMBER_ID; + }, + get similarSearchHash() { + return this.searchQueryJSON?.similarSearchHash ?? CONST.DEFAULT_NUMBER_ID; + }, + }, [CONST.SEARCH.SEARCH_KEYS.RECONCILIATION]: { key: CONST.SEARCH.SEARCH_KEYS.RECONCILIATION, - translationPath: 'search.reconciliation', + translationPath: 'workspace.common.reimburse', type: CONST.SEARCH.DATA_TYPES.EXPENSE, icon: 'Bank', - searchQuery: buildQueryStringFromFilterFormValues({ - type: CONST.SEARCH.DATA_TYPES.EXPENSE, - withdrawalType: CONST.SEARCH.WITHDRAWAL_TYPE.REIMBURSEMENT, - withdrawnOn: CONST.SEARCH.DATE_PRESETS.LAST_MONTH, - groupBy: CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID, - }), + searchQuery: buildQueryStringFromFilterFormValues( + { + type: CONST.SEARCH.DATA_TYPES.EXPENSE, + withdrawalType: CONST.SEARCH.WITHDRAWAL_TYPE.REIMBURSEMENT, + withdrawnOn: CONST.SEARCH.DATE_PRESETS.LAST_MONTH, + groupBy: CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID, + view: CONST.SEARCH.VIEW.TABLE, + }, + { + sortBy: CONST.SEARCH.TABLE_COLUMNS.GROUP_WITHDRAWN, + sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + }, + ), get searchQueryJSON() { return buildSearchQueryJSON(this.searchQuery); }, @@ -868,7 +903,8 @@ function getSuggestedSearchesVisibility( let shouldShowStatementsSuggestion = false; let shouldShowUnapprovedCashSuggestion = false; let shouldShowUnapprovedCardSuggestion = false; - let shouldShowReconciliationSuggestion = false; + let shouldShowExpensifyCardSuggestion = false; + let shouldShowReimbursementsSuggestion = false; let shouldShowTopSpendersSuggestion = false; let shouldShowTopCategoriesSuggestion = false; let shouldShowTopMerchantsSuggestion = false; @@ -907,7 +943,8 @@ function getSuggestedSearchesVisibility( const isEligibleForStatementsSuggestion = isPaidPolicy && !!policy.areCompanyCardsEnabled && hasCardFeed; const isEligibleForUnapprovedCashSuggestion = isPaidPolicy && isAdmin && isApprovalEnabled && isPaymentEnabled; const isEligibleForUnapprovedCardSuggestion = isPaidPolicy && isAdmin && isApprovalEnabled && (hasCardFeed || !!defaultExpensifyCard); - const isEligibleForReconciliationSuggestion = isPaidPolicy && isAdmin && ((isPaymentEnabled && hasVBBA && hasReimburser) || isECardEnabled); + const isEligibleForExpensifyCardSuggestion = isPaidPolicy && isAdmin && isECardEnabled; + const isEligibleForReimbursementsSuggestion = isPaidPolicy && isAdmin && isPaymentEnabled && hasVBBA && hasReimburser; const isAuditor = policy.role === CONST.POLICY.ROLE.AUDITOR; const isEligibleForTopSpendersSuggestion = isPaidPolicy && (isAdmin || isAuditor || isApprover); const isEligibleForTopCategoriesSuggestion = isPaidPolicy && policy.areCategoriesEnabled === true; @@ -921,7 +958,8 @@ function getSuggestedSearchesVisibility( shouldShowStatementsSuggestion ||= isEligibleForStatementsSuggestion; shouldShowUnapprovedCashSuggestion ||= isEligibleForUnapprovedCashSuggestion; shouldShowUnapprovedCardSuggestion ||= isEligibleForUnapprovedCardSuggestion; - shouldShowReconciliationSuggestion ||= isEligibleForReconciliationSuggestion; + shouldShowExpensifyCardSuggestion ||= isEligibleForExpensifyCardSuggestion; + shouldShowReimbursementsSuggestion ||= isEligibleForReimbursementsSuggestion; shouldShowTopSpendersSuggestion ||= isEligibleForTopSpendersSuggestion; shouldShowTopCategoriesSuggestion ||= isEligibleForTopCategoriesSuggestion; shouldShowTopMerchantsSuggestion ||= isEligibleForTopMerchantsSuggestion; @@ -942,7 +980,8 @@ function getSuggestedSearchesVisibility( shouldShowStatementsSuggestion && shouldShowUnapprovedCashSuggestion && shouldShowUnapprovedCardSuggestion && - shouldShowReconciliationSuggestion && + shouldShowExpensifyCardSuggestion && + shouldShowReimbursementsSuggestion && shouldShowTopSpendersSuggestion && shouldShowTopCategoriesSuggestion && shouldShowTopMerchantsSuggestion && @@ -962,7 +1001,8 @@ function getSuggestedSearchesVisibility( [CONST.SEARCH.SEARCH_KEYS.STATEMENTS]: shouldShowStatementsSuggestion, [CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH]: shouldShowUnapprovedCashSuggestion, [CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD]: shouldShowUnapprovedCardSuggestion, - [CONST.SEARCH.SEARCH_KEYS.RECONCILIATION]: shouldShowReconciliationSuggestion, + [CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD]: shouldShowExpensifyCardSuggestion, + [CONST.SEARCH.SEARCH_KEYS.RECONCILIATION]: shouldShowReimbursementsSuggestion, [CONST.SEARCH.SEARCH_KEYS.TOP_SPENDERS]: shouldShowTopSpendersSuggestion, [CONST.SEARCH.SEARCH_KEYS.TOP_CATEGORIES]: shouldShowTopCategoriesSuggestion, [CONST.SEARCH.SEARCH_KEYS.TOP_MERCHANTS]: shouldShowTopMerchantsSuggestion, @@ -3520,24 +3560,15 @@ function createTypeMenuSections( } } - // Accounting section + // Monthly accrual section { - const accountingSection: SearchTypeMenuSection = { - translationPath: 'workspace.common.accounting', + const monthlyAccrualSection: SearchTypeMenuSection = { + translationPath: 'search.monthlyAccrual', menuItems: [], }; - if (suggestedSearchesVisibility[CONST.SEARCH.SEARCH_KEYS.STATEMENTS]) { - accountingSection.menuItems.push({ - ...suggestedSearches[CONST.SEARCH.SEARCH_KEYS.STATEMENTS], - emptyState: { - title: 'search.searchResults.emptyStatementsResults.title', - subtitle: 'search.searchResults.emptyStatementsResults.subtitle', - }, - }); - } if (suggestedSearchesVisibility[CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH]) { - accountingSection.menuItems.push({ + monthlyAccrualSection.menuItems.push({ ...suggestedSearches[CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH], emptyState: { title: 'search.searchResults.emptyUnapprovedResults.title', @@ -3546,7 +3577,7 @@ function createTypeMenuSections( }); } if (suggestedSearchesVisibility[CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD]) { - accountingSection.menuItems.push({ + monthlyAccrualSection.menuItems.push({ ...suggestedSearches[CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD], emptyState: { title: 'search.searchResults.emptyUnapprovedResults.title', @@ -3554,8 +3585,39 @@ function createTypeMenuSections( }, }); } + + if (monthlyAccrualSection.menuItems.length > 0) { + typeMenuSections.push(monthlyAccrualSection); + } + } + + // Reconciliation section + { + const reconciliationSection: SearchTypeMenuSection = { + translationPath: 'search.reconciliation', + menuItems: [], + }; + + if (suggestedSearchesVisibility[CONST.SEARCH.SEARCH_KEYS.STATEMENTS]) { + reconciliationSection.menuItems.push({ + ...suggestedSearches[CONST.SEARCH.SEARCH_KEYS.STATEMENTS], + emptyState: { + title: 'search.searchResults.emptyStatementsResults.title', + subtitle: 'search.searchResults.emptyStatementsResults.subtitle', + }, + }); + } + if (suggestedSearchesVisibility[CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD]) { + reconciliationSection.menuItems.push({ + ...suggestedSearches[CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD], + emptyState: { + title: 'search.searchResults.emptyStatementsResults.title', + subtitle: 'search.searchResults.emptyStatementsResults.subtitle', + }, + }); + } if (suggestedSearchesVisibility[CONST.SEARCH.SEARCH_KEYS.RECONCILIATION]) { - accountingSection.menuItems.push({ + reconciliationSection.menuItems.push({ ...suggestedSearches[CONST.SEARCH.SEARCH_KEYS.RECONCILIATION], emptyState: { title: 'search.searchResults.emptyStatementsResults.title', @@ -3564,8 +3626,8 @@ function createTypeMenuSections( }); } - if (accountingSection.menuItems.length > 0) { - typeMenuSections.push(accountingSection); + if (reconciliationSection.menuItems.length > 0) { + typeMenuSections.push(reconciliationSection); } } diff --git a/tests/unit/Search/SearchUIUtilsTest.ts b/tests/unit/Search/SearchUIUtilsTest.ts index d3a86f6120b3a..f4c5a9f56bff2 100644 --- a/tests/unit/Search/SearchUIUtilsTest.ts +++ b/tests/unit/Search/SearchUIUtilsTest.ts @@ -4836,7 +4836,7 @@ describe('SearchUIUtils', () => { expect(menuItemKeys).toContain(CONST.SEARCH.SEARCH_KEYS.EXPORT); }); - it('should show accounting section with statements, unapproved cash, unapproved card, and reconciliation items', () => { + it('should show monthly accrual and reconciliation sections with expected items', () => { const mockPolicies = { policy1: { id: 'policy1', @@ -4888,15 +4888,22 @@ describe('SearchUIUtils', () => { false, ); - const accountingSection = sections.find((section) => section.translationPath === 'workspace.common.accounting'); - expect(accountingSection).toBeDefined(); - expect(accountingSection?.menuItems.length).toBeGreaterThan(0); + const monthlyAccrualSection = sections.find((section) => section.translationPath === 'search.monthlyAccrual'); + expect(monthlyAccrualSection).toBeDefined(); + expect(monthlyAccrualSection?.menuItems.length).toBeGreaterThan(0); - const menuItemKeys = accountingSection?.menuItems.map((item) => item.key) ?? []; - expect(menuItemKeys).toContain(CONST.SEARCH.SEARCH_KEYS.STATEMENTS); - expect(menuItemKeys).toContain(CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH); - expect(menuItemKeys).toContain(CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD); - expect(menuItemKeys).toContain(CONST.SEARCH.SEARCH_KEYS.RECONCILIATION); + const monthlyAccrualKeys = monthlyAccrualSection?.menuItems.map((item) => item.key) ?? []; + expect(monthlyAccrualKeys).toContain(CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH); + expect(monthlyAccrualKeys).toContain(CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD); + + const reconciliationSection = sections.find((section) => section.translationPath === 'search.reconciliation'); + expect(reconciliationSection).toBeDefined(); + expect(reconciliationSection?.menuItems.length).toBeGreaterThan(0); + + const reconciliationKeys = reconciliationSection?.menuItems.map((item) => item.key) ?? []; + expect(reconciliationKeys).toContain(CONST.SEARCH.SEARCH_KEYS.STATEMENTS); + expect(reconciliationKeys).toContain(CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD); + expect(reconciliationKeys).toContain(CONST.SEARCH.SEARCH_KEYS.RECONCILIATION); }); it('should show saved section when there are saved searches', () => { @@ -5009,7 +5016,7 @@ describe('SearchUIUtils', () => { expect(todoSection).toBeUndefined(); }); - it('should not show accounting section when user has no admin permissions or card feeds', () => { + it('should not show monthly accrual or reconciliation sections when user has no admin permissions or card feeds', () => { const mockPolicies = { policy1: { id: 'policy1', @@ -5037,8 +5044,10 @@ describe('SearchUIUtils', () => { false, ); - const accountingSection = sections.find((section) => section.translationPath === 'workspace.common.accounting'); - expect(accountingSection).toBeUndefined(); + const monthlyAccrualSection = sections.find((section) => section.translationPath === 'search.monthlyAccrual'); + const reconciliationSection = sections.find((section) => section.translationPath === 'search.reconciliation'); + expect(monthlyAccrualSection).toBeUndefined(); + expect(reconciliationSection).toBeUndefined(); }); it('should show reconciliation for ACH-only scenario (payments enabled, active VBBA, reimburser set, areExpensifyCardsEnabled = false)', () => { @@ -5068,14 +5077,15 @@ describe('SearchUIUtils', () => { const {result: icons} = renderHook(() => useMemoizedLazyExpensifyIcons(['Document', 'Send', 'ThumbsUp'])); const sections = SearchUIUtils.createTypeMenuSections(icons.current, adminEmail, adminAccountID, {}, undefined, mockPolicies, {}, false, undefined, false); - const accountingSection = sections.find((section) => section.translationPath === 'workspace.common.accounting'); - expect(accountingSection).toBeDefined(); + const reconciliationSection = sections.find((section) => section.translationPath === 'search.reconciliation'); + expect(reconciliationSection).toBeDefined(); - const menuItemKeys = accountingSection?.menuItems.map((item) => item.key) ?? []; + const menuItemKeys = reconciliationSection?.menuItems.map((item) => item.key) ?? []; + expect(menuItemKeys).not.toContain(CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD); expect(menuItemKeys).toContain(CONST.SEARCH.SEARCH_KEYS.RECONCILIATION); }); - it('should not show reconciliation for card-only scenario without card feeds (areExpensifyCardsEnabled = true but no card feeds)', () => { + it('should show only expensify card in reconciliation for card-only scenario without card feeds', () => { const mockPolicies = { policy1: { id: 'policy1', @@ -5093,11 +5103,13 @@ describe('SearchUIUtils', () => { const mockCardFeedsByPolicy: Record = {}; const {result: icons} = renderHook(() => useMemoizedLazyExpensifyIcons(['Document', 'Send', 'ThumbsUp'])); const sections = SearchUIUtils.createTypeMenuSections(icons.current, adminEmail, adminAccountID, mockCardFeedsByPolicy, undefined, mockPolicies, {}, false, undefined, false); - const accountingSection = sections.find((section) => section.translationPath === 'workspace.common.accounting'); + const reconciliationSection = sections.find((section) => section.translationPath === 'search.reconciliation'); + expect(reconciliationSection).toBeDefined(); - expect(accountingSection).toBeDefined(); - const menuItemKeys = accountingSection?.menuItems.map((item) => item.key) ?? []; - expect(menuItemKeys).toContain(CONST.SEARCH.SEARCH_KEYS.RECONCILIATION); + const menuItemKeys = reconciliationSection?.menuItems.map((item) => item.key) ?? []; + expect(menuItemKeys).toContain(CONST.SEARCH.SEARCH_KEYS.EXPENSIFY_CARD); + expect(menuItemKeys).not.toContain(CONST.SEARCH.SEARCH_KEYS.RECONCILIATION); + expect(menuItemKeys).not.toContain(CONST.SEARCH.SEARCH_KEYS.STATEMENTS); }); it('should generate correct routes', () => {