diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index e7aebfacc092..c69752f0892f 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -8846,7 +8846,6 @@ function canIOUBePaid( invoiceReceiverPolicy?: SearchPolicy, shouldCheckApprovedState = true, ) { - const isPolicyExpenseChat = isPolicyExpenseChatReportUtil(chatReport); const reportNameValuePairs = chatReportRNVP ?? allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${chatReport?.reportID}`]; const isChatReportArchived = isArchivedReport(reportNameValuePairs); const iouSettled = isSettled(iouReport); @@ -8884,7 +8883,7 @@ function canIOUBePaid( policy, ); - const isOpenExpenseReport = isPolicyExpenseChat && isOpenExpenseReportReportUtils(iouReport); + const isOpenExpenseReport = isOpenExpenseReportReportUtils(iouReport); const {reimbursableSpend} = getMoneyRequestSpendBreakdown(iouReport); const isAutoReimbursable = policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES ? false : canBeAutoReimbursed(iouReport, policy); diff --git a/tests/unit/Search/SearchUIUtilsTest.ts b/tests/unit/Search/SearchUIUtilsTest.ts index af86b5759963..45eb8e0c5682 100644 --- a/tests/unit/Search/SearchUIUtilsTest.ts +++ b/tests/unit/Search/SearchUIUtilsTest.ts @@ -388,7 +388,7 @@ const reportActionListItems = [ const transactionsListItems = [ { accountID: 18439984, - action: 'pay', + action: 'submit', amount: -5000, canDelete: true, canHold: true, @@ -599,7 +599,7 @@ const transactionsListItems = [ const reportsListItems = [ { accountID: 18439984, - action: 'pay', + action: 'submit', chatReportID: '1706144653204915', created: '2024-12-21 13:05:20', currency: 'USD', @@ -631,7 +631,7 @@ const reportsListItems = [ transactions: [ { accountID: 18439984, - action: 'pay', + action: 'submit', amount: -5000, canDelete: true, canHold: true, @@ -818,15 +818,15 @@ const reportsListItems = [ describe('SearchUIUtils', () => { describe('Test getAction', () => { - test('Should return `Pay` action for transaction on policy with no approvals and no violations', () => { + test('Should return `Submit` action for transaction on policy with delayed submission and no violations', () => { let action = SearchUIUtils.getAction(searchResults.data, `report_${reportID}`); - expect(action).toStrictEqual(CONST.SEARCH.ACTION_TYPES.PAY); + expect(action).toStrictEqual(CONST.SEARCH.ACTION_TYPES.SUBMIT); action = SearchUIUtils.getAction(searchResults.data, `transactions_${transactionID}`); - expect(action).toStrictEqual(CONST.SEARCH.ACTION_TYPES.PAY); + expect(action).toStrictEqual(CONST.SEARCH.ACTION_TYPES.SUBMIT); }); - test('Should return `Review` action for transaction on policy with no approvals and with violations', () => { + test('Should return `Review` action for transaction on policy with delayed submission and with violations', () => { let action = SearchUIUtils.getAction(searchResults.data, `report_${reportID2}`); expect(action).toStrictEqual(CONST.SEARCH.ACTION_TYPES.REVIEW);