diff --git a/tests/unit/Search/SearchUIUtilsTest.ts b/tests/unit/Search/SearchUIUtilsTest.ts index 589c626096af..fe44ad259d44 100644 --- a/tests/unit/Search/SearchUIUtilsTest.ts +++ b/tests/unit/Search/SearchUIUtilsTest.ts @@ -515,838 +515,829 @@ const reportsListItems = [ }, ] as ReportListItemType[]; -afterEach(() => { - jest.clearAllMocks(); -}); - -// When the results are filtered by type "expense" to be displayed on the search page -const transactionSections = SearchUIUtils.getSections('expense', 'all', searchResults.data, searchResults.search) as TransactionListItemType[]; -const tests = transactionSections.map((transactionList) => [{transactionListItem: transactionList, expectedMerchant: CONST.TRANSACTION.DEFAULT_MERCHANT}]); - -// Then verify the merchant column is displayed as "Expense", and does not contain an empty string describe('SearchUIUtils', () => { - test.each(tests)('Transaction list item with "Expense" merchant', ({transactionListItem, expectedMerchant}) => { - expect(transactionListItem.merchant).toEqual(expectedMerchant); + afterEach(() => { + jest.clearAllMocks(); }); -}); -describe('Test getAction', () => { - test('Should return `Pay` action for transaction on policy with no approvals and no violations', () => { - let action = SearchUIUtils.getAction(searchResults.data, `report_${reportID}`); - expect(action).toEqual(CONST.SEARCH.ACTION_TYPES.PAY); + describe('Test getAction', () => { + test('Should return `Pay` action for transaction on policy with no approvals and no violations', () => { + let action = SearchUIUtils.getAction(searchResults.data, `report_${reportID}`); + expect(action).toEqual(CONST.SEARCH.ACTION_TYPES.PAY); - action = SearchUIUtils.getAction(searchResults.data, `transactions_${transactionID}`); - expect(action).toEqual(CONST.SEARCH.ACTION_TYPES.PAY); - }); + action = SearchUIUtils.getAction(searchResults.data, `transactions_${transactionID}`); + expect(action).toEqual(CONST.SEARCH.ACTION_TYPES.PAY); + }); - test('Should return `Review` action for transaction on policy with no approvals and with violations', () => { - let action = SearchUIUtils.getAction(searchResults.data, `report_${reportID2}`); - expect(action).toEqual(CONST.SEARCH.ACTION_TYPES.REVIEW); + test('Should return `Review` action for transaction on policy with no approvals and with violations', () => { + let action = SearchUIUtils.getAction(searchResults.data, `report_${reportID2}`); + expect(action).toEqual(CONST.SEARCH.ACTION_TYPES.REVIEW); - action = SearchUIUtils.getAction(searchResults.data, `transactions_${transactionID2}`); - expect(action).toEqual(CONST.SEARCH.ACTION_TYPES.REVIEW); + action = SearchUIUtils.getAction(searchResults.data, `transactions_${transactionID2}`); + expect(action).toEqual(CONST.SEARCH.ACTION_TYPES.REVIEW); + }); }); -}); -describe('Test getListItem', () => { - it('should return ChatListItem when type is CHAT', () => { - expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.CHAT, 'all')).toEqual(ChatListItem); - }); + describe('Test getListItem', () => { + it('should return ChatListItem when type is CHAT', () => { + expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.CHAT, 'all')).toEqual(ChatListItem); + }); - it('should return TransactionListItem when type is EXPENSE and shouldGroupByReports is false', () => { - expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', false)).toEqual(TransactionListItem); - }); + it('should return TransactionListItem when type is EXPENSE and shouldGroupByReports is false', () => { + expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', false)).toEqual(TransactionListItem); + }); - it('should return ReportListItem when type is EXPENSE and shouldGroupByReports is true', () => { - expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', true)).toEqual(ReportListItem); - }); + it('should return ReportListItem when type is EXPENSE and shouldGroupByReports is true', () => { + expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', true)).toEqual(ReportListItem); + }); - it('should return ReportListItem when type is TRIP', () => { - expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.TRIP, 'all')).toEqual(ReportListItem); - }); + it('should return ReportListItem when type is TRIP', () => { + expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.TRIP, 'all')).toEqual(ReportListItem); + }); - it('should return ReportListItem when type is INVOICE', () => { - expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.INVOICE, 'all')).toEqual(ReportListItem); + it('should return ReportListItem when type is INVOICE', () => { + expect(SearchUIUtils.getListItem(CONST.SEARCH.DATA_TYPES.INVOICE, 'all')).toEqual(ReportListItem); + }); }); -}); -describe('getSections', () => { - it('should return getReportActionsSections result when type is CHAT', () => { - expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.CHAT, 'all', searchResults.data, searchResults.search)).toEqual(reportActionListItems); - }); + describe('getSections', () => { + it('should return getReportActionsSections result when type is CHAT', () => { + expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.CHAT, 'all', searchResults.data, searchResults.search)).toEqual(reportActionListItems); + }); - it('should return getTransactionsSections result when type is EXPENSE and shouldGroupByReports is false', () => { - expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', searchResults.data, searchResults.search, false)).toEqual(transactionsListItems); - }); + it('should return getTransactionsSections result when type is EXPENSE and shouldGroupByReports is false', () => { + expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', searchResults.data, searchResults.search, false)).toEqual(transactionsListItems); + }); - it('should return getReportSections result when type is EXPENSE and shouldGroupByReports is true', () => { - expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', searchResults.data, searchResults.search, true)).toEqual(reportsListItems); - }); + it('should return getReportSections result when type is EXPENSE and shouldGroupByReports is true', () => { + expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', searchResults.data, searchResults.search, true)).toEqual(reportsListItems); + }); - it('should return getReportSections result when type is TRIP', () => { - expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.TRIP, 'all', searchResults.data, searchResults.search)).toEqual(reportsListItems); - }); + it('should return getReportSections result when type is TRIP', () => { + expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.TRIP, 'all', searchResults.data, searchResults.search)).toEqual(reportsListItems); + }); - it('should return getReportSections result when type is INVOICE', () => { - expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.INVOICE, 'all', searchResults.data, searchResults.search)).toEqual(reportsListItems); + it('should return getReportSections result when type is INVOICE', () => { + expect(SearchUIUtils.getSections(CONST.SEARCH.DATA_TYPES.INVOICE, 'all', searchResults.data, searchResults.search)).toEqual(reportsListItems); + }); }); -}); -describe('Test getSortedSections', () => { - it('should return getSortedReportActionData result when type is CHAT', () => { - expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.CHAT, 'all', reportActionListItems)).toEqual([ - { - accountID: 18439984, - actionName: 'ADDCOMMENT', - created: '2024-12-21 13:05:20', - date: '2024-12-21 13:05:20', - formattedFrom: 'test', - from: { + describe('Test getSortedSections', () => { + it('should return getSortedReportActionData result when type is CHAT', () => { + expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.CHAT, 'all', reportActionListItems)).toEqual([ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - keyForList: 'test', - message: [ - { - html: '
Payment has been processed.
', - text: 'Payment has been processed.', - type: 'text', - whisperedTo: [12345678, 87654321], - }, - { - html: 'Please review this expense.
', - text: 'Please review this expense.', - type: 'comment', + actionName: 'ADDCOMMENT', + created: '2024-12-21 13:05:20', + date: '2024-12-21 13:05:20', + formattedFrom: 'test', + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', }, - ], - reportActionID: 'test', - reportID: '123456789', - reportName: 'Unavailable workspace owes $50.00', - }, - ]); - }); - - it('should return getSortedTransactionData result when type is EXPENSE and shouldGroupByReports is false', () => { - expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', transactionsListItems, 'date', 'asc', false)).toEqual([ - { - accountID: 18439984, - action: 'pay', - amount: -5000, - canDelete: true, - canHold: true, - canUnhold: false, - category: '', - comment: { - comment: '', - }, - created: '2024-12-21', - currency: 'USD', - date: '2024-12-21', - description: '', - formattedFrom: 'test', - formattedMerchant: 'Expense', - formattedTo: 'test', - formattedTotal: 5000, - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - hasEReceipt: false, - hasViolation: false, - isFromOneTransactionReport: true, - keyForList: '1', - managerID: 18439984, - merchant: 'Expense', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: 'Expense', - parentTransactionID: '', - policyID: 'A1B2C3', - reportID: '123456789', - reportType: 'expense', - shouldShowCategory: true, - shouldShowMerchant: true, - shouldShowTag: false, - shouldShowTax: false, - shouldShowYear: true, - tag: '', - to: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - transactionID: '1', - transactionThreadReportID: '456', - transactionType: 'cash', - }, - { - accountID: 18439984, - action: 'review', - amount: -5000, - canDelete: true, - canHold: true, - canUnhold: false, - category: '', - comment: { - comment: '', + keyForList: 'test', + message: [ + { + html: 'Payment has been processed.
', + text: 'Payment has been processed.', + type: 'text', + whisperedTo: [12345678, 87654321], + }, + { + html: 'Please review this expense.
', + text: 'Please review this expense.', + type: 'comment', + }, + ], + reportActionID: 'test', + reportID: '123456789', + reportName: 'Unavailable workspace owes $50.00', }, - created: '2024-12-21', - currency: 'USD', - date: '2024-12-21', - description: '', - formattedFrom: 'test', - formattedMerchant: 'Expense', - formattedTo: 'test', - formattedTotal: 5000, - from: { + ]); + }); + + it('should return getSortedTransactionData result when type is EXPENSE and shouldGroupByReports is false', () => { + expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', transactionsListItems, 'date', 'asc', false)).toEqual([ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + action: 'pay', + amount: -5000, + canDelete: true, + canHold: true, + canUnhold: false, + category: '', + comment: { + comment: '', + }, + created: '2024-12-21', + currency: 'USD', + date: '2024-12-21', + description: '', + formattedFrom: 'test', + formattedMerchant: 'Expense', + formattedTo: 'test', + formattedTotal: 5000, + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + hasEReceipt: false, + hasViolation: false, + isFromOneTransactionReport: true, + keyForList: '1', + managerID: 18439984, + merchant: 'Expense', + modifiedAmount: 0, + modifiedCreated: '', + modifiedCurrency: '', + modifiedMerchant: 'Expense', + parentTransactionID: '', + policyID: 'A1B2C3', + reportID: '123456789', + reportType: 'expense', + shouldShowCategory: true, + shouldShowMerchant: true, + shouldShowTag: false, + shouldShowTax: false, + shouldShowYear: true, + tag: '', + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + transactionID: '1', + transactionThreadReportID: '456', + transactionType: 'cash', }, - hasEReceipt: false, - hasViolation: true, - isFromOneTransactionReport: true, - keyForList: '2', - managerID: 18439984, - merchant: 'Expense', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: 'Expense', - parentTransactionID: '', - policyID: 'A1B2C3', - reportID: '11111', - reportType: 'expense', - shouldShowCategory: true, - shouldShowMerchant: true, - shouldShowTag: false, - shouldShowTax: false, - shouldShowYear: true, - tag: '', - to: { + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + action: 'review', + amount: -5000, + canDelete: true, + canHold: true, + canUnhold: false, + category: '', + comment: { + comment: '', + }, + created: '2024-12-21', + currency: 'USD', + date: '2024-12-21', + description: '', + formattedFrom: 'test', + formattedMerchant: 'Expense', + formattedTo: 'test', + formattedTotal: 5000, + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + hasEReceipt: false, + hasViolation: true, + isFromOneTransactionReport: true, + keyForList: '2', + managerID: 18439984, + merchant: 'Expense', + modifiedAmount: 0, + modifiedCreated: '', + modifiedCurrency: '', + modifiedMerchant: 'Expense', + parentTransactionID: '', + policyID: 'A1B2C3', + reportID: '11111', + reportType: 'expense', + shouldShowCategory: true, + shouldShowMerchant: true, + shouldShowTag: false, + shouldShowTax: false, + shouldShowYear: true, + tag: '', + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + transactionID: '2', + transactionThreadReportID: '456', + transactionType: 'cash', }, - transactionID: '2', - transactionThreadReportID: '456', - transactionType: 'cash', - }, - ]); - }); + ]); + }); - it('should return getSortedReportData result when type is EXPENSE and shouldGroupByReports is true', () => { - expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', reportsListItems, 'date', 'asc', true)).toEqual([ - { - accountID: 18439984, - action: 'pay', - chatReportID: '1706144653204915', - created: '2024-12-21 13:05:20', - currency: 'USD', - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - isOneTransactionReport: true, - isPolicyExpenseChat: false, - isWaitingOnBankAccount: false, - keyForList: '123456789', - managerID: 18439984, - nonReimbursableTotal: 0, - ownerAccountID: 18439984, - policyID: 'A1B2C3', - reportID: '123456789', - reportName: 'Expense Report #123', - stateNum: 1, - statusNum: 1, - to: { + it('should return getSortedReportData result when type is EXPENSE and shouldGroupByReports is true', () => { + expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.EXPENSE, 'all', reportsListItems, 'date', 'asc', true)).toEqual([ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - total: -5000, - transactions: [ - { + action: 'pay', + chatReportID: '1706144653204915', + created: '2024-12-21 13:05:20', + currency: 'USD', + from: { accountID: 18439984, - action: 'pay', - amount: -5000, - canDelete: true, - canHold: true, - canUnhold: false, - category: '', - comment: { - comment: '', - }, - created: '2024-12-21', - currency: 'USD', - date: '2024-12-21', - description: '', - formattedFrom: 'test', - formattedMerchant: 'Expense', - formattedTo: 'test', - formattedTotal: 5000, - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - hasEReceipt: false, - hasViolation: false, - isFromOneTransactionReport: true, - keyForList: '1', - managerID: 18439984, - merchant: 'Expense', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: 'Expense', - parentTransactionID: '', - policyID: 'A1B2C3', - reportID: '123456789', - reportType: 'expense', - shouldShowCategory: true, - shouldShowMerchant: true, - shouldShowTag: false, - shouldShowTax: false, - shouldShowYear: true, - tag: '', - to: { + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + isOneTransactionReport: true, + isPolicyExpenseChat: false, + isWaitingOnBankAccount: false, + keyForList: '123456789', + managerID: 18439984, + nonReimbursableTotal: 0, + ownerAccountID: 18439984, + policyID: 'A1B2C3', + reportID: '123456789', + reportName: 'Expense Report #123', + stateNum: 1, + statusNum: 1, + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + total: -5000, + transactions: [ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + action: 'pay', + amount: -5000, + canDelete: true, + canHold: true, + canUnhold: false, + category: '', + comment: { + comment: '', + }, + created: '2024-12-21', + currency: 'USD', + date: '2024-12-21', + description: '', + formattedFrom: 'test', + formattedMerchant: 'Expense', + formattedTo: 'test', + formattedTotal: 5000, + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + hasEReceipt: false, + hasViolation: false, + isFromOneTransactionReport: true, + keyForList: '1', + managerID: 18439984, + merchant: 'Expense', + modifiedAmount: 0, + modifiedCreated: '', + modifiedCurrency: '', + modifiedMerchant: 'Expense', + parentTransactionID: '', + policyID: 'A1B2C3', + reportID: '123456789', + reportType: 'expense', + shouldShowCategory: true, + shouldShowMerchant: true, + shouldShowTag: false, + shouldShowTax: false, + shouldShowYear: true, + tag: '', + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + transactionID: '1', + transactionThreadReportID: '456', + transactionType: 'cash', }, - transactionID: '1', - transactionThreadReportID: '456', - transactionType: 'cash', - }, - ], - type: 'expense', - unheldTotal: -5000, - }, - { - accountID: 18439984, - action: 'review', - chatReportID: '1706144653204915', - created: '2024-12-21 13:05:20', - currency: 'USD', - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + ], + type: 'expense', + unheldTotal: -5000, }, - isOneTransactionReport: true, - isPolicyExpenseChat: false, - isWaitingOnBankAccount: false, - keyForList: '11111', - managerID: 18439984, - nonReimbursableTotal: 0, - ownerAccountID: 18439984, - policyID: 'A1B2C3', - reportID: '11111', - reportName: 'Expense Report #123', - stateNum: 1, - statusNum: 1, - to: { + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - total: -5000, - transactions: [ - { + action: 'review', + chatReportID: '1706144653204915', + created: '2024-12-21 13:05:20', + currency: 'USD', + from: { accountID: 18439984, - action: 'review', - amount: -5000, - canDelete: true, - canHold: true, - canUnhold: false, - category: '', - comment: { - comment: '', - }, - created: '2024-12-21', - currency: 'USD', - date: '2024-12-21', - description: '', - formattedFrom: 'test', - formattedMerchant: 'Expense', - formattedTo: 'test', - formattedTotal: 5000, - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - hasEReceipt: false, - hasViolation: true, - isFromOneTransactionReport: true, - keyForList: '2', - managerID: 18439984, - merchant: 'Expense', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: 'Expense', - parentTransactionID: '', - policyID: 'A1B2C3', - reportID: '11111', - reportType: 'expense', - shouldShowCategory: true, - shouldShowMerchant: true, - shouldShowTag: false, - shouldShowTax: false, - shouldShowYear: true, - tag: '', - to: { + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + isOneTransactionReport: true, + isPolicyExpenseChat: false, + isWaitingOnBankAccount: false, + keyForList: '11111', + managerID: 18439984, + nonReimbursableTotal: 0, + ownerAccountID: 18439984, + policyID: 'A1B2C3', + reportID: '11111', + reportName: 'Expense Report #123', + stateNum: 1, + statusNum: 1, + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + total: -5000, + transactions: [ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + action: 'review', + amount: -5000, + canDelete: true, + canHold: true, + canUnhold: false, + category: '', + comment: { + comment: '', + }, + created: '2024-12-21', + currency: 'USD', + date: '2024-12-21', + description: '', + formattedFrom: 'test', + formattedMerchant: 'Expense', + formattedTo: 'test', + formattedTotal: 5000, + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + hasEReceipt: false, + hasViolation: true, + isFromOneTransactionReport: true, + keyForList: '2', + managerID: 18439984, + merchant: 'Expense', + modifiedAmount: 0, + modifiedCreated: '', + modifiedCurrency: '', + modifiedMerchant: 'Expense', + parentTransactionID: '', + policyID: 'A1B2C3', + reportID: '11111', + reportType: 'expense', + shouldShowCategory: true, + shouldShowMerchant: true, + shouldShowTag: false, + shouldShowTax: false, + shouldShowYear: true, + tag: '', + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + transactionID: '2', + transactionThreadReportID: '456', + transactionType: 'cash', }, - transactionID: '2', - transactionThreadReportID: '456', - transactionType: 'cash', - }, - ], - type: 'expense', - unheldTotal: -5000, - }, - ]); - }); - - it('should return getSortedReportData result when type is TRIP', () => { - expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.TRIP, 'all', reportsListItems)).toEqual([ - { - accountID: 18439984, - action: 'pay', - chatReportID: '1706144653204915', - created: '2024-12-21 13:05:20', - currency: 'USD', - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + ], + type: 'expense', + unheldTotal: -5000, }, - isOneTransactionReport: true, - isPolicyExpenseChat: false, - isWaitingOnBankAccount: false, - keyForList: '123456789', - managerID: 18439984, - nonReimbursableTotal: 0, - ownerAccountID: 18439984, - policyID: 'A1B2C3', - reportID: '123456789', - reportName: 'Expense Report #123', - stateNum: 1, - statusNum: 1, - to: { + ]); + }); + + it('should return getSortedReportData result when type is TRIP', () => { + expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.TRIP, 'all', reportsListItems)).toEqual([ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - total: -5000, - transactions: [ - { + action: 'pay', + chatReportID: '1706144653204915', + created: '2024-12-21 13:05:20', + currency: 'USD', + from: { accountID: 18439984, - action: 'pay', - amount: -5000, - canDelete: true, - canHold: true, - canUnhold: false, - category: '', - comment: { - comment: '', - }, - created: '2024-12-21', - currency: 'USD', - date: '2024-12-21', - description: '', - formattedFrom: 'test', - formattedMerchant: 'Expense', - formattedTo: 'test', - formattedTotal: 5000, - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - hasEReceipt: false, - hasViolation: false, - isFromOneTransactionReport: true, - keyForList: '1', - managerID: 18439984, - merchant: 'Expense', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: 'Expense', - parentTransactionID: '', - policyID: 'A1B2C3', - reportID: '123456789', - reportType: 'expense', - shouldShowCategory: true, - shouldShowMerchant: true, - shouldShowTag: false, - shouldShowTax: false, - shouldShowYear: true, - tag: '', - to: { + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + isOneTransactionReport: true, + isPolicyExpenseChat: false, + isWaitingOnBankAccount: false, + keyForList: '123456789', + managerID: 18439984, + nonReimbursableTotal: 0, + ownerAccountID: 18439984, + policyID: 'A1B2C3', + reportID: '123456789', + reportName: 'Expense Report #123', + stateNum: 1, + statusNum: 1, + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + total: -5000, + transactions: [ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + action: 'pay', + amount: -5000, + canDelete: true, + canHold: true, + canUnhold: false, + category: '', + comment: { + comment: '', + }, + created: '2024-12-21', + currency: 'USD', + date: '2024-12-21', + description: '', + formattedFrom: 'test', + formattedMerchant: 'Expense', + formattedTo: 'test', + formattedTotal: 5000, + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + hasEReceipt: false, + hasViolation: false, + isFromOneTransactionReport: true, + keyForList: '1', + managerID: 18439984, + merchant: 'Expense', + modifiedAmount: 0, + modifiedCreated: '', + modifiedCurrency: '', + modifiedMerchant: 'Expense', + parentTransactionID: '', + policyID: 'A1B2C3', + reportID: '123456789', + reportType: 'expense', + shouldShowCategory: true, + shouldShowMerchant: true, + shouldShowTag: false, + shouldShowTax: false, + shouldShowYear: true, + tag: '', + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + transactionID: '1', + transactionThreadReportID: '456', + transactionType: 'cash', }, - transactionID: '1', - transactionThreadReportID: '456', - transactionType: 'cash', - }, - ], - type: 'expense', - unheldTotal: -5000, - }, - { - accountID: 18439984, - action: 'review', - chatReportID: '1706144653204915', - created: '2024-12-21 13:05:20', - currency: 'USD', - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + ], + type: 'expense', + unheldTotal: -5000, }, - isOneTransactionReport: true, - isPolicyExpenseChat: false, - isWaitingOnBankAccount: false, - keyForList: '11111', - managerID: 18439984, - nonReimbursableTotal: 0, - ownerAccountID: 18439984, - policyID: 'A1B2C3', - reportID: '11111', - reportName: 'Expense Report #123', - stateNum: 1, - statusNum: 1, - to: { + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - total: -5000, - transactions: [ - { + action: 'review', + chatReportID: '1706144653204915', + created: '2024-12-21 13:05:20', + currency: 'USD', + from: { accountID: 18439984, - action: 'review', - amount: -5000, - canDelete: true, - canHold: true, - canUnhold: false, - category: '', - comment: { - comment: '', - }, - created: '2024-12-21', - currency: 'USD', - date: '2024-12-21', - description: '', - formattedFrom: 'test', - formattedMerchant: 'Expense', - formattedTo: 'test', - formattedTotal: 5000, - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - hasEReceipt: false, - hasViolation: true, - isFromOneTransactionReport: true, - keyForList: '2', - managerID: 18439984, - merchant: 'Expense', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: 'Expense', - parentTransactionID: '', - policyID: 'A1B2C3', - reportID: '11111', - reportType: 'expense', - shouldShowCategory: true, - shouldShowMerchant: true, - shouldShowTag: false, - shouldShowTax: false, - shouldShowYear: true, - tag: '', - to: { + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + isOneTransactionReport: true, + isPolicyExpenseChat: false, + isWaitingOnBankAccount: false, + keyForList: '11111', + managerID: 18439984, + nonReimbursableTotal: 0, + ownerAccountID: 18439984, + policyID: 'A1B2C3', + reportID: '11111', + reportName: 'Expense Report #123', + stateNum: 1, + statusNum: 1, + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + total: -5000, + transactions: [ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + action: 'review', + amount: -5000, + canDelete: true, + canHold: true, + canUnhold: false, + category: '', + comment: { + comment: '', + }, + created: '2024-12-21', + currency: 'USD', + date: '2024-12-21', + description: '', + formattedFrom: 'test', + formattedMerchant: 'Expense', + formattedTo: 'test', + formattedTotal: 5000, + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + hasEReceipt: false, + hasViolation: true, + isFromOneTransactionReport: true, + keyForList: '2', + managerID: 18439984, + merchant: 'Expense', + modifiedAmount: 0, + modifiedCreated: '', + modifiedCurrency: '', + modifiedMerchant: 'Expense', + parentTransactionID: '', + policyID: 'A1B2C3', + reportID: '11111', + reportType: 'expense', + shouldShowCategory: true, + shouldShowMerchant: true, + shouldShowTag: false, + shouldShowTax: false, + shouldShowYear: true, + tag: '', + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + transactionID: '2', + transactionThreadReportID: '456', + transactionType: 'cash', }, - transactionID: '2', - transactionThreadReportID: '456', - transactionType: 'cash', - }, - ], - type: 'expense', - unheldTotal: -5000, - }, - ]); - }); - - it('should return getSortedReportData result when type is INVOICE', () => { - expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.INVOICE, 'all', reportsListItems)).toEqual([ - { - accountID: 18439984, - action: 'pay', - chatReportID: '1706144653204915', - created: '2024-12-21 13:05:20', - currency: 'USD', - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + ], + type: 'expense', + unheldTotal: -5000, }, - isOneTransactionReport: true, - isPolicyExpenseChat: false, - isWaitingOnBankAccount: false, - keyForList: '123456789', - managerID: 18439984, - nonReimbursableTotal: 0, - ownerAccountID: 18439984, - policyID: 'A1B2C3', - reportID: '123456789', - reportName: 'Expense Report #123', - stateNum: 1, - statusNum: 1, - to: { + ]); + }); + + it('should return getSortedReportData result when type is INVOICE', () => { + expect(SearchUIUtils.getSortedSections(CONST.SEARCH.DATA_TYPES.INVOICE, 'all', reportsListItems)).toEqual([ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - total: -5000, - transactions: [ - { + action: 'pay', + chatReportID: '1706144653204915', + created: '2024-12-21 13:05:20', + currency: 'USD', + from: { accountID: 18439984, - action: 'pay', - amount: -5000, - canDelete: true, - canHold: true, - canUnhold: false, - category: '', - comment: { - comment: '', - }, - created: '2024-12-21', - currency: 'USD', - date: '2024-12-21', - description: '', - formattedFrom: 'test', - formattedMerchant: 'Expense', - formattedTo: 'test', - formattedTotal: 5000, - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - hasEReceipt: false, - hasViolation: false, - isFromOneTransactionReport: true, - keyForList: '1', - managerID: 18439984, - merchant: 'Expense', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: 'Expense', - parentTransactionID: '', - policyID: 'A1B2C3', - reportID: '123456789', - reportType: 'expense', - shouldShowCategory: true, - shouldShowMerchant: true, - shouldShowTag: false, - shouldShowTax: false, - shouldShowYear: true, - tag: '', - to: { + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + isOneTransactionReport: true, + isPolicyExpenseChat: false, + isWaitingOnBankAccount: false, + keyForList: '123456789', + managerID: 18439984, + nonReimbursableTotal: 0, + ownerAccountID: 18439984, + policyID: 'A1B2C3', + reportID: '123456789', + reportName: 'Expense Report #123', + stateNum: 1, + statusNum: 1, + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + total: -5000, + transactions: [ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + action: 'pay', + amount: -5000, + canDelete: true, + canHold: true, + canUnhold: false, + category: '', + comment: { + comment: '', + }, + created: '2024-12-21', + currency: 'USD', + date: '2024-12-21', + description: '', + formattedFrom: 'test', + formattedMerchant: 'Expense', + formattedTo: 'test', + formattedTotal: 5000, + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + hasEReceipt: false, + hasViolation: false, + isFromOneTransactionReport: true, + keyForList: '1', + managerID: 18439984, + merchant: 'Expense', + modifiedAmount: 0, + modifiedCreated: '', + modifiedCurrency: '', + modifiedMerchant: 'Expense', + parentTransactionID: '', + policyID: 'A1B2C3', + reportID: '123456789', + reportType: 'expense', + shouldShowCategory: true, + shouldShowMerchant: true, + shouldShowTag: false, + shouldShowTax: false, + shouldShowYear: true, + tag: '', + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + transactionID: '1', + transactionThreadReportID: '456', + transactionType: 'cash', }, - transactionID: '1', - transactionThreadReportID: '456', - transactionType: 'cash', - }, - ], - type: 'expense', - unheldTotal: -5000, - }, - { - accountID: 18439984, - action: 'review', - chatReportID: '1706144653204915', - created: '2024-12-21 13:05:20', - currency: 'USD', - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + ], + type: 'expense', + unheldTotal: -5000, }, - isOneTransactionReport: true, - isPolicyExpenseChat: false, - isWaitingOnBankAccount: false, - keyForList: '11111', - managerID: 18439984, - nonReimbursableTotal: 0, - ownerAccountID: 18439984, - policyID: 'A1B2C3', - reportID: '11111', - reportName: 'Expense Report #123', - stateNum: 1, - statusNum: 1, - to: { + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - total: -5000, - transactions: [ - { + action: 'review', + chatReportID: '1706144653204915', + created: '2024-12-21 13:05:20', + currency: 'USD', + from: { accountID: 18439984, - action: 'review', - amount: -5000, - canDelete: true, - canHold: true, - canUnhold: false, - category: '', - comment: { - comment: '', - }, - created: '2024-12-21', - currency: 'USD', - date: '2024-12-21', - description: '', - formattedFrom: 'test', - formattedMerchant: 'Expense', - formattedTo: 'test', - formattedTotal: 5000, - from: { - accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', - }, - hasEReceipt: false, - hasViolation: true, - isFromOneTransactionReport: true, - keyForList: '2', - managerID: 18439984, - merchant: 'Expense', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: 'Expense', - parentTransactionID: '', - policyID: 'A1B2C3', - reportID: '11111', - reportType: 'expense', - shouldShowCategory: true, - shouldShowMerchant: true, - shouldShowTag: false, - shouldShowTax: false, - shouldShowYear: true, - tag: '', - to: { + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + isOneTransactionReport: true, + isPolicyExpenseChat: false, + isWaitingOnBankAccount: false, + keyForList: '11111', + managerID: 18439984, + nonReimbursableTotal: 0, + ownerAccountID: 18439984, + policyID: 'A1B2C3', + reportID: '11111', + reportName: 'Expense Report #123', + stateNum: 1, + statusNum: 1, + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + total: -5000, + transactions: [ + { accountID: 18439984, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', - displayName: 'test', - login: 'test1234@gmail.com', + action: 'review', + amount: -5000, + canDelete: true, + canHold: true, + canUnhold: false, + category: '', + comment: { + comment: '', + }, + created: '2024-12-21', + currency: 'USD', + date: '2024-12-21', + description: '', + formattedFrom: 'test', + formattedMerchant: 'Expense', + formattedTo: 'test', + formattedTotal: 5000, + from: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + hasEReceipt: false, + hasViolation: true, + isFromOneTransactionReport: true, + keyForList: '2', + managerID: 18439984, + merchant: 'Expense', + modifiedAmount: 0, + modifiedCreated: '', + modifiedCurrency: '', + modifiedMerchant: 'Expense', + parentTransactionID: '', + policyID: 'A1B2C3', + reportID: '11111', + reportType: 'expense', + shouldShowCategory: true, + shouldShowMerchant: true, + shouldShowTag: false, + shouldShowTax: false, + shouldShowYear: true, + tag: '', + to: { + accountID: 18439984, + avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', + displayName: 'test', + login: 'test1234@gmail.com', + }, + transactionID: '2', + transactionThreadReportID: '456', + transactionType: 'cash', }, - transactionID: '2', - transactionThreadReportID: '456', - transactionType: 'cash', - }, - ], - type: 'expense', - unheldTotal: -5000, - }, - ]); + ], + type: 'expense', + unheldTotal: -5000, + }, + ]); + }); }); -}); -describe('Test createTypeMenuItems', () => { - it('should return the default menu items', () => { - const menuItems = SearchUIUtils.createTypeMenuItems(null, undefined); - expect(menuItems).toHaveLength(4); - expect(menuItems).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - translationPath: 'common.expenses', - type: CONST.SEARCH.DATA_TYPES.EXPENSE, - icon: Expensicons.Receipt, - }), - expect.objectContaining({ - translationPath: 'common.expenseReports', - type: CONST.SEARCH.DATA_TYPES.EXPENSE, - icon: Expensicons.Document, - }), - expect.objectContaining({ - translationPath: 'common.chats', - type: CONST.SEARCH.DATA_TYPES.CHAT, - icon: Expensicons.ChatBubbles, - }), - expect.objectContaining({ - translationPath: 'travel.trips', - type: CONST.SEARCH.DATA_TYPES.TRIP, - icon: Expensicons.Suitcase, - }), - ]), - ); - }); + describe('Test createTypeMenuItems', () => { + it('should return the default menu items', () => { + const menuItems = SearchUIUtils.createTypeMenuItems(null, undefined); + expect(menuItems).toHaveLength(4); + expect(menuItems).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + translationPath: 'common.expenses', + type: CONST.SEARCH.DATA_TYPES.EXPENSE, + icon: Expensicons.Receipt, + }), + expect.objectContaining({ + translationPath: 'common.expenseReports', + type: CONST.SEARCH.DATA_TYPES.EXPENSE, + icon: Expensicons.Document, + }), + expect.objectContaining({ + translationPath: 'common.chats', + type: CONST.SEARCH.DATA_TYPES.CHAT, + icon: Expensicons.ChatBubbles, + }), + expect.objectContaining({ + translationPath: 'travel.trips', + type: CONST.SEARCH.DATA_TYPES.TRIP, + icon: Expensicons.Suitcase, + }), + ]), + ); + }); - it('should generate correct routes', () => { - const menuItems = SearchUIUtils.createTypeMenuItems(null, undefined); + it('should generate correct routes', () => { + const menuItems = SearchUIUtils.createTypeMenuItems(null, undefined); - const expectedRoutes = [ - ROUTES.SEARCH_ROOT.getRoute({query: 'type:expense status:all sortBy:date sortOrder:desc'}), - ROUTES.SEARCH_ROOT.getRoute({query: 'type:expense status:all sortBy:date sortOrder:desc', groupBy: 'reports'}), - ROUTES.SEARCH_ROOT.getRoute({query: 'type:chat status:all sortBy:date sortOrder:desc'}), - ROUTES.SEARCH_ROOT.getRoute({query: 'type:trip status:all sortBy:date sortOrder:desc'}), - ]; + const expectedRoutes = [ + ROUTES.SEARCH_ROOT.getRoute({query: 'type:expense status:all sortBy:date sortOrder:desc'}), + ROUTES.SEARCH_ROOT.getRoute({query: 'type:expense status:all sortBy:date sortOrder:desc', groupBy: 'reports'}), + ROUTES.SEARCH_ROOT.getRoute({query: 'type:chat status:all sortBy:date sortOrder:desc'}), + ROUTES.SEARCH_ROOT.getRoute({query: 'type:trip status:all sortBy:date sortOrder:desc'}), + ]; - menuItems.forEach((item, index) => { - expect(item.getRoute()).toBe(expectedRoutes.at(index)); + menuItems.forEach((item, index) => { + expect(item.getRoute()).toBe(expectedRoutes.at(index)); + }); }); }); });