From a7f9b0ae746e2829b529fdaadd870ab98e5343e5 Mon Sep 17 00:00:00 2001 From: Piyush Date: Wed, 10 Dec 2025 13:35:53 +0530 Subject: [PATCH 1/3] Fix description with markdown is shown as HTML tags --- src/libs/actions/IOU.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 2ecb8d587fdc..f01bf07209d0 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -5856,7 +5856,7 @@ function convertBulkTrackedExpensesToIOU( const actionableWhisperReportActionID = getTrackExpenseActionableWhisper(transactionID, selfDMReportID)?.reportActionID; const commentText = typeof transaction.comment === 'string' ? transaction.comment : (transaction.comment?.comment ?? ''); - const parsedComment = getParsedComment(commentText); + const parsedComment = getParsedComment(Parser.htmlToMarkdown(commentText)); const attendees = transaction.comment?.attendees; From b3c0650a1dbb60ddffa463105aaf073d877c742e Mon Sep 17 00:00:00 2001 From: Piyush Date: Wed, 10 Dec 2025 14:52:24 +0530 Subject: [PATCH 2/3] Fix typecheck --- tests/unit/Search/SearchContextTest.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/Search/SearchContextTest.tsx b/tests/unit/Search/SearchContextTest.tsx index 2d973768314d..50349b9f27d9 100644 --- a/tests/unit/Search/SearchContextTest.tsx +++ b/tests/unit/Search/SearchContextTest.tsx @@ -68,6 +68,7 @@ const mockTransaction: TransactionListItemType = { isAmountColumnWide: false, isTaxAmountColumnWide: false, shouldAnimateInHighlight: false, + canDelete: true, report: { reportID: '515146912679679', }, From 6d82786d93c373e68565ec982b54656b60487bdd Mon Sep 17 00:00:00 2001 From: Piyush Date: Wed, 17 Dec 2025 08:45:20 +0530 Subject: [PATCH 3/3] remove SearchContextTest --- tests/unit/Search/SearchContextTest.tsx | 157 ------------------------ 1 file changed, 157 deletions(-) delete mode 100644 tests/unit/Search/SearchContextTest.tsx diff --git a/tests/unit/Search/SearchContextTest.tsx b/tests/unit/Search/SearchContextTest.tsx deleted file mode 100644 index 50349b9f27d9..000000000000 --- a/tests/unit/Search/SearchContextTest.tsx +++ /dev/null @@ -1,157 +0,0 @@ -import {renderHook} from '@testing-library/react-native'; -import React, {act} from 'react'; -import {SearchContextProvider, useSearchContext} from '@components/Search/SearchContext'; -import type {SelectedTransactionInfo} from '@components/Search/types'; -import type {TransactionListItemType, TransactionReportGroupListItemType} from '@components/SelectionListWithSections/types'; - -const mockSelectedTransaction: SelectedTransactionInfo = { - action: 'approve', - canHold: true, - isHeld: false, - canSplit: false, - hasBeenSplit: false, - canUnhold: false, - canChangeReport: true, - isSelected: true, - canDelete: true, - policyID: '06F34677820A4D07', - reportID: '515146912679679', - amount: 0, - groupAmount: 1284, - groupCurrency: 'USD', - currency: 'USD', - ownerAccountID: 1, -} as const; - -const mockTransaction: TransactionListItemType = { - accountID: 1, - amount: 0, - category: '', - groupAmount: 1284, - groupCurrency: 'USD', - created: '2025-09-19', - currency: 'USD', - policy: { - id: '06F34677820A4D07', - type: 'team', - role: 'admin', - owner: 'test@test.com', - name: 'Policy', - outputCurrency: 'USD', - isPolicyExpenseChatEnabled: true, - }, - reportAction: { - reportActionID: '2454187434077044186', - actionName: 'IOU', - created: '2025-09-19', - }, - holdReportAction: undefined, - merchant: '(none)', - modifiedAmount: -1284, - modifiedCreated: '2025-09-07', - modifiedCurrency: 'USD', - modifiedMerchant: 'The Home Depot', - policyID: '06F34677820A4D07', - reportID: '515146912679679', - tag: '', - transactionID: '1', - action: 'approve', - allActions: ['approve'], - formattedFrom: 'Main Applause QA', - formattedTo: 'Main Applause QA', - formattedTotal: -1284, - formattedMerchant: 'The Home Depot', - date: '2025-09-07', - shouldShowMerchant: true, - shouldShowYear: true, - keyForList: '1', - isAmountColumnWide: false, - isTaxAmountColumnWide: false, - shouldAnimateInHighlight: false, - canDelete: true, - report: { - reportID: '515146912679679', - }, - from: { - accountID: 1, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_15.png', - displayName: 'Main Applause QA', - }, - to: { - accountID: 1, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_15.png', - displayName: 'Main Applause QA', - }, -}; - -const mockReport: TransactionReportGroupListItemType = { - accountID: 1, - chatReportID: '4735435600700077', - chatType: undefined, - created: '2025-09-19 20:00:47', - currency: 'USD', - isOneTransactionReport: true, - isOwnPolicyExpenseChat: false, - isWaitingOnBankAccount: false, - managerID: 1, - nonReimbursableTotal: 0, - oldPolicyName: '', - ownerAccountID: 1, - parentReportActionID: '2454187434077044186', - parentReportID: '4735435600700077', - policyID: '06F34677820A4D07', - reportID: '515146912679679', - reportName: 'Expense Report #515146912679679', - stateNum: 1, - statusNum: 1, - total: -1284, - type: 'expense', - unheldTotal: -1284, - from: { - accountID: 1, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_15.png', - displayName: 'Main Applause QA', - }, - to: { - accountID: 1, - avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_15.png', - displayName: 'Main Applause QA', - }, - shouldShowYear: false, - action: 'view', - transactions: [mockTransaction], - groupedBy: 'expense-report', - keyForList: '515146912679679', -}; - -mockTransaction.report = mockReport; - -const wrapper = ({children}: {children: React.ReactNode}) => {children}; - -describe('SearchContext', () => { - it('returns selectedReports for TransactionReportGroupListItem', () => { - const {result} = renderHook(() => useSearchContext(), {wrapper}); - act(() => { - result.current.setSelectedTransactions({[mockTransaction.keyForList]: mockSelectedTransaction}, [mockReport]); - }); - const selectedReport = result.current.selectedReports.at(0); - - expect(selectedReport?.managerID).toEqual(1); - expect(selectedReport?.ownerAccountID).toBe(1); - expect(selectedReport?.parentReportActionID).toBe('2454187434077044186'); - expect(selectedReport?.parentReportID).toBe('4735435600700077'); - }); - - it('returns selectedReports for TransactionListItemType', () => { - const {result} = renderHook(() => useSearchContext(), {wrapper}); - act(() => { - result.current.setSelectedTransactions({[mockTransaction.keyForList]: mockSelectedTransaction}, [mockTransaction]); - }); - const selectedReport = result.current.selectedReports.at(0); - - expect(selectedReport?.managerID).toEqual(1); - expect(selectedReport?.ownerAccountID).toBe(1); - expect(selectedReport?.parentReportActionID).toBe('2454187434077044186'); - expect(selectedReport?.parentReportID).toBe('4735435600700077'); - }); -});