From 94cbe2e0566f53c8fe3eed4b12c196381b9e2b87 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 20 Aug 2026 23:17:42 +0530 Subject: [PATCH 1/4] fix: stop showing the canceled status on expense previews Signed-off-by: krishna2323 --- .../ReportPreviewHeader.tsx | 5 +---- .../TransactionPreview/TransactionPreviewContent.tsx | 11 ++--------- src/libs/TransactionPreviewUtils.ts | 12 +++--------- tests/unit/TransactionPreviewUtils.test.ts | 11 ++--------- 4 files changed, 8 insertions(+), 31 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx index e065af642c5d..cba808917a03 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx @@ -66,9 +66,6 @@ function ReportPreviewHeader() { [translate, numberOfRequests], ); - // A cancelled payment is a report level event and it isn't surfaced by the status badge, so we show it next to the expense count. - const supportingText = iouReport?.isCancelledIOU ? `${translate('iou.canceled')} ${CONST.DOT_SEPARATOR} ${expenseCount}` : expenseCount; - const reportStateNum = iouReport?.stateNum ?? action?.childStateNum; const reportStatusNum = iouReport?.statusNum ?? action?.childStatusNum; @@ -125,7 +122,7 @@ function ReportPreviewHeader() { tooltipText={reportStatusTooltip} /> )} - {!shouldShowAccessPlaceHolder && {supportingText}} + {!shouldShowAccessPlaceHolder && {expenseCount}} ) )} diff --git a/src/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx b/src/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx index da0f404b93ff..abe103137a48 100644 --- a/src/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx +++ b/src/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx @@ -2,7 +2,6 @@ import MultiAccountAvatar from '@components/Avatar/connected/MultiAccountAvatar' import Button from '@components/ButtonComposed'; import Icon from '@components/Icon'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; -import {ReportPreviewDataContext} from '@components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContext'; import ReportActionItemImages from '@components/ReportActionItem/ReportActionItemImages'; import UserInfoCellsWithArrow from '@components/Search/SearchList/ListItem/UserInfoCellsWithArrow'; import Text from '@components/Text'; @@ -46,7 +45,7 @@ import {cardByIdSelector} from '@src/selectors/Card'; import {getStableReportSelector} from '@src/selectors/Report'; import truncate from 'lodash/truncate'; -import React, {useContext, useMemo} from 'react'; +import React, {useMemo} from 'react'; import {View} from 'react-native'; import Animated from 'react-native-reanimated'; @@ -135,11 +134,6 @@ function TransactionPreviewContent({ const {shouldShowRBR, shouldShowMerchant, shouldShowSplitShare, shouldShowCategory, shouldShowSkeleton, shouldShowDescription} = conditionals; - // Raw useContext (not the useReportPreviewData slice hook, which throws when absent): a missing provider means this is a - // standalone preview with no report header to carry the status, so the preview has to report a cancelled payment itself. - const isInsideReportPreview = !!useContext(ReportPreviewDataContext); - const shouldShowCanceledStatus = !isInsideReportPreview; - const isIOUActionType = isMoneyRequestAction(action); const canEdit = isIOUActionType && canEditMoneyRequest(action, transaction, isChatReportArchived, report, policy, reportActions); const companyCardPageURL = `${environmentURL}/${ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(report?.policyID)}`; @@ -169,13 +163,12 @@ function TransactionPreviewContent({ dateFnsLocale, ...transactionPreviewCommonArguments, shouldShowRBR, - shouldShowCanceledStatus, violationMessage, reportActions, originalTransaction, convertToDisplayString, }), - [transactionPreviewCommonArguments, shouldShowRBR, shouldShowCanceledStatus, violationMessage, reportActions, originalTransaction, convertToDisplayString, dateFnsLocale], + [transactionPreviewCommonArguments, shouldShowRBR, violationMessage, reportActions, originalTransaction, convertToDisplayString, dateFnsLocale], ); const getTranslatedText = (item: TranslationPathOrText) => (item.translationPath ? translate(item.translationPath) : (item.text ?? '')); diff --git a/src/libs/TransactionPreviewUtils.ts b/src/libs/TransactionPreviewUtils.ts index 8933f4e71166..d41466aef9ac 100644 --- a/src/libs/TransactionPreviewUtils.ts +++ b/src/libs/TransactionPreviewUtils.ts @@ -210,7 +210,6 @@ function getTransactionPreviewTextAndTranslationPaths({ transactionDetails, isBillSplit, shouldShowRBR, - shouldShowCanceledStatus, violationMessage, reportActions, originalTransaction, @@ -225,8 +224,6 @@ function getTransactionPreviewTextAndTranslationPaths({ transactionDetails: Partial; isBillSplit: boolean; shouldShowRBR: boolean; - /** Whether a cancelled payment has to be reported on this line, because the enclosing surface doesn't show it anywhere else */ - shouldShowCanceledStatus: boolean; violationMessage?: string; reportActions?: OnyxTypes.ReportActions; originalTransaction?: OnyxEntry; @@ -329,18 +326,15 @@ function getTransactionPreviewTextAndTranslationPaths({ previewDateText = {text: date}; } - // Paid, Approved, Review required and the hold message are intentionally omitted here because the report status badge and the - // RBR row already show them, so repeating them on this line is noise. Canceled is the exception: it can't be derived from - // stateNum/statusNum, so surfaces without their own report status badge have to report it here. + // Paid, Approved, Review required, Canceled and the hold message are intentionally omitted here because the report status badge + // and the RBR row already show them, so repeating them on this line is noise. const previewStatusText: TranslationPathOrText[] = []; if (isPending(transaction)) { previewStatusText.push({translationPath: 'iou.pending'}); } - if (shouldShowCanceledStatus && iouReport?.isCancelledIOU) { - previewStatusText.push({translationPath: 'iou.canceled'}); - } else if (hasPendingRTERViolation(violations)) { + if (hasPendingRTERViolation(violations)) { previewStatusText.push({translationPath: 'iou.pendingMatch'}); } diff --git a/tests/unit/TransactionPreviewUtils.test.ts b/tests/unit/TransactionPreviewUtils.test.ts index 06abc3eb869c..70bdb65ce02e 100644 --- a/tests/unit/TransactionPreviewUtils.test.ts +++ b/tests/unit/TransactionPreviewUtils.test.ts @@ -54,7 +54,6 @@ const basicProps = { transactionDetails: {}, isBillSplit: false, shouldShowRBR: false, - shouldShowCanceledStatus: false, isReportAPolicyExpenseChat: false, areThereDuplicates: false, currentUserEmail: '', @@ -256,18 +255,12 @@ describe('TransactionPreviewUtils', () => { expect(result.displayAmountText.text).toEqual(convertAmountToDisplayString(modifiedAmount, currency)); }); - it('does not show the canceled status inside a report preview, because the preview header already shows it', () => { - const functionArgs = {...basicProps, iouReport: {...basicProps.iouReport, isCancelledIOU: true}, originalTransaction: undefined, shouldShowCanceledStatus: false}; + it('does not show the canceled status, because it is a report level event that previews do not surface', () => { + const functionArgs = {...basicProps, iouReport: {...basicProps.iouReport, isCancelledIOU: true}, originalTransaction: undefined}; const result = getTransactionPreviewTextAndTranslationPaths(functionArgs); expect(result.previewStatusText).toEqual([]); }); - it('shows the canceled status in a standalone preview, because nothing else on that surface reports it', () => { - const functionArgs = {...basicProps, iouReport: {...basicProps.iouReport, isCancelledIOU: true}, originalTransaction: undefined, shouldShowCanceledStatus: true}; - const result = getTransactionPreviewTextAndTranslationPaths(functionArgs); - expect(result.previewStatusText).toContainEqual({translationPath: 'iou.canceled'}); - }); - it('does not show the approved status when the report is approved, because it is redundant with the report status badge', () => { const functionArgs = { ...basicProps, From 4aaae0fc68d7e0397453f561ea8a89fe575c82c4 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 20 Aug 2026 23:37:41 +0530 Subject: [PATCH 2/4] refactor: drop the dead tag conditional and tighten the preview metadata assertion Signed-off-by: krishna2323 --- src/libs/TransactionPreviewUtils.ts | 18 ++++++++++----- tests/ui/MoneyRequestReportPreview.test.tsx | 5 +++-- tests/unit/TransactionPreviewUtils.test.ts | 25 +++++++++++++++------ 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/libs/TransactionPreviewUtils.ts b/src/libs/TransactionPreviewUtils.ts index d41466aef9ac..158e42d8eb97 100644 --- a/src/libs/TransactionPreviewUtils.ts +++ b/src/libs/TransactionPreviewUtils.ts @@ -326,8 +326,8 @@ function getTransactionPreviewTextAndTranslationPaths({ previewDateText = {text: date}; } - // Paid, Approved, Review required, Canceled and the hold message are intentionally omitted here because the report status badge - // and the RBR row already show them, so repeating them on this line is noise. + // Paid, Approved, Review required and the hold message are intentionally omitted here because the report status badge and the + // RBR row already show them, so repeating them on this line is noise. const previewStatusText: TranslationPathOrText[] = []; if (isPending(transaction)) { @@ -338,6 +338,16 @@ function getTransactionPreviewTextAndTranslationPaths({ previewStatusText.push({translationPath: 'iou.pendingMatch'}); } + // Canceled has to stay in step with the status it used to sit behind: an approved but unsettled group policy expense report + // reads "Approved", and Canceled was never reached in that case. Widening it here would surface the status on surfaces that + // cannot render it consistently, so the visibility is deliberately left exactly as it was. + const isPartialHold = isSettlementOrApprovalPartial && isTransactionOnHold; + const isApprovedAndUnsettled = isExpenseReport(iouReport) && isGroupPolicy && isReportApproved({report: iouReport}) && !isMoneyRequestSettled && !isPartialHold; + + if (iouReport?.isCancelledIOU && !isApprovedAndUnsettled) { + previewStatusText.push({translationPath: 'iou.canceled'}); + } + const amount = isBillSplit ? getAmount(originalTransaction ?? transaction) : requestAmount; let displayAmountText: TranslationPathOrText = isTransactionScanning ? {translationPath: 'iou.receiptStatusTitle'} : {text: convertToDisplayString(amount, requestCurrency)}; if (isFetchingWaypoints && !requestAmount) { @@ -388,7 +398,7 @@ function createTransactionPreviewConditionals({ currentUserAccountID: number; reportActions?: OnyxTypes.ReportActions; }) { - const {amount: requestAmount, comment: requestComment, merchant, tag, category} = transactionDetails; + const {amount: requestAmount, comment: requestComment, merchant, category} = transactionDetails; const requestMerchant = truncate(merchant, {length: CONST.REQUEST_PREVIEW.MAX_LENGTH}); const description = truncate(StringUtils.lineBreaksToSpaces(requestComment), {length: CONST.REQUEST_PREVIEW.MAX_LENGTH}); @@ -410,7 +420,6 @@ function createTransactionPreviewConditionals({ const isFullyApproved = isApproved && !isSettlementOrApprovalPartial; const shouldShowSkeleton = isEmptyObject(transaction) && !isMessageDeleted(action) && !isDeletedAction(action) && action?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; - const shouldShowTag = !!tag && isReportAPolicyExpenseChat; const categoryForDisplay = isCategoryMissing(category) ? '' : category; @@ -444,7 +453,6 @@ function createTransactionPreviewConditionals({ return { shouldShowSkeleton, - shouldShowTag, shouldShowRBR, shouldShowCategory, shouldShowKeepButton, diff --git a/tests/ui/MoneyRequestReportPreview.test.tsx b/tests/ui/MoneyRequestReportPreview.test.tsx index 443126b30bb0..7eb25ba3d10b 100644 --- a/tests/ui/MoneyRequestReportPreview.test.tsx +++ b/tests/ui/MoneyRequestReportPreview.test.tsx @@ -180,8 +180,9 @@ const getTransactionDisplayAmountAndMetadataText = (transaction: Transaction) => const created = getFormattedCreated(transaction); const date = DateUtils.formatWithUTCTimeZone(created, DateUtils.doesDateBelongToAPastYear(created) ? CONST.DATE.MONTH_DAY_YEAR_ABBR_FORMAT : CONST.DATE.MONTH_DAY_ABBR_FORMAT, undefined); const isTransactionMadeWithCard = isManagedCardTransaction(transaction); - // The date leads the supporting line, which can also carry the category and the report status. - const transactionSupportingText = new RegExp(`^${date}`); + // The supporting line carries the date, then the category and any status. These transactions have neither, so the date is the + // whole line and is asserted exactly - a prefix match would let an unexpected category or status slip through. + const transactionSupportingText = date; const transactionTypeText = isTransactionMadeWithCard ? TestHelper.translateLocal('iou.card') : TestHelper.translateLocal('iou.cash'); const transactionDisplayAmount = TestHelper.convertToDisplayString(-transaction.amount, transaction.currency); return {transactionSupportingText, transactionTypeText, transactionDisplayAmount}; diff --git a/tests/unit/TransactionPreviewUtils.test.ts b/tests/unit/TransactionPreviewUtils.test.ts index 70bdb65ce02e..b05ba302ba50 100644 --- a/tests/unit/TransactionPreviewUtils.test.ts +++ b/tests/unit/TransactionPreviewUtils.test.ts @@ -255,9 +255,26 @@ describe('TransactionPreviewUtils', () => { expect(result.displayAmountText.text).toEqual(convertAmountToDisplayString(modifiedAmount, currency)); }); - it('does not show the canceled status, because it is a report level event that previews do not surface', () => { + it('shows the canceled status when the report does not already read as approved', () => { const functionArgs = {...basicProps, iouReport: {...basicProps.iouReport, isCancelledIOU: true}, originalTransaction: undefined}; const result = getTransactionPreviewTextAndTranslationPaths(functionArgs); + expect(result.previewStatusText).toContainEqual({translationPath: 'iou.canceled'}); + }); + + it('does not show the canceled status on an approved, unsettled expense report, because it reads as approved instead', () => { + const functionArgs = { + ...basicProps, + iouReport: { + ...basicProps.iouReport, + type: CONST.REPORT.TYPE.EXPENSE, + stateNum: CONST.REPORT.STATE_NUM.APPROVED, + statusNum: CONST.REPORT.STATUS_NUM.APPROVED, + isCancelledIOU: true, + }, + policy: createRandomPolicy(1, CONST.POLICY.TYPE.CORPORATE), + originalTransaction: undefined, + }; + const result = getTransactionPreviewTextAndTranslationPaths(functionArgs); expect(result.previewStatusText).toEqual([]); }); @@ -531,12 +548,6 @@ describe('TransactionPreviewUtils', () => { expect(result.shouldShowDescription).toBeFalsy(); }); - it("should show tag if it's a policy expense chat and tag is present", () => { - const functionArgs = {...basicProps, isReportAPolicyExpenseChat: true, transactionDetails: {tag: 'Transport'}}; - const result = createTransactionPreviewConditionals(functionArgs); - expect(result.shouldShowTag).toBeTruthy(); - }); - it('should correctly show violation message if there are multiple violations', () => { const functionArgs = { ...basicProps, From 2375cfbc61cd7b644420a5c412cb6a2e12983e41 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 20 Aug 2026 23:49:13 +0530 Subject: [PATCH 3/4] fix: keep the canceled status off reports that already read as approved Signed-off-by: krishna2323 --- .../ReportPreviewHeader.tsx | 8 +++++++- src/libs/TransactionPreviewUtils.ts | 14 ++------------ tests/unit/TransactionPreviewUtils.test.ts | 19 +------------------ 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx index cba808917a03..0e0f050233c0 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx @@ -81,6 +81,12 @@ function ReportPreviewHeader() { const shouldShowReportStatus = !!reportStatus && !!expenseCount; + // A cancelled payment is a report level event that the status badge can't express, so it goes next to the expense count. + // It is skipped once the report reads as approved, because that is the state cancelling returns an approving workspace to and + // the badge already says so - the same precedence the expense preview used before this moved up to the report level. + const isApprovedReport = reportStateNum === CONST.REPORT.STATE_NUM.APPROVED && reportStatusNum === CONST.REPORT.STATUS_NUM.APPROVED; + const supportingText = iouReport?.isCancelledIOU && !isApprovedReport ? `${translate('iou.canceled')} ${CONST.DOT_SEPARATOR} ${expenseCount}` : expenseCount; + const reportStatusColorStyle = useMemo(() => getReportStatusColorStyle(theme, reportStateNum, reportStatusNum), [reportStateNum, reportStatusNum, theme]); const reportStatusTooltip = useMemo( @@ -122,7 +128,7 @@ function ReportPreviewHeader() { tooltipText={reportStatusTooltip} /> )} - {!shouldShowAccessPlaceHolder && {expenseCount}} + {!shouldShowAccessPlaceHolder && {supportingText}} ) )} diff --git a/src/libs/TransactionPreviewUtils.ts b/src/libs/TransactionPreviewUtils.ts index 158e42d8eb97..5e3e971862c1 100644 --- a/src/libs/TransactionPreviewUtils.ts +++ b/src/libs/TransactionPreviewUtils.ts @@ -326,8 +326,8 @@ function getTransactionPreviewTextAndTranslationPaths({ previewDateText = {text: date}; } - // Paid, Approved, Review required and the hold message are intentionally omitted here because the report status badge and the - // RBR row already show them, so repeating them on this line is noise. + // Paid, Approved, Review required, Canceled and the hold message are intentionally omitted here because the report status badge, + // the report preview header and the RBR row already show them, so repeating them on this line is noise. const previewStatusText: TranslationPathOrText[] = []; if (isPending(transaction)) { @@ -338,16 +338,6 @@ function getTransactionPreviewTextAndTranslationPaths({ previewStatusText.push({translationPath: 'iou.pendingMatch'}); } - // Canceled has to stay in step with the status it used to sit behind: an approved but unsettled group policy expense report - // reads "Approved", and Canceled was never reached in that case. Widening it here would surface the status on surfaces that - // cannot render it consistently, so the visibility is deliberately left exactly as it was. - const isPartialHold = isSettlementOrApprovalPartial && isTransactionOnHold; - const isApprovedAndUnsettled = isExpenseReport(iouReport) && isGroupPolicy && isReportApproved({report: iouReport}) && !isMoneyRequestSettled && !isPartialHold; - - if (iouReport?.isCancelledIOU && !isApprovedAndUnsettled) { - previewStatusText.push({translationPath: 'iou.canceled'}); - } - const amount = isBillSplit ? getAmount(originalTransaction ?? transaction) : requestAmount; let displayAmountText: TranslationPathOrText = isTransactionScanning ? {translationPath: 'iou.receiptStatusTitle'} : {text: convertToDisplayString(amount, requestCurrency)}; if (isFetchingWaypoints && !requestAmount) { diff --git a/tests/unit/TransactionPreviewUtils.test.ts b/tests/unit/TransactionPreviewUtils.test.ts index b05ba302ba50..d611e3064c1a 100644 --- a/tests/unit/TransactionPreviewUtils.test.ts +++ b/tests/unit/TransactionPreviewUtils.test.ts @@ -255,26 +255,9 @@ describe('TransactionPreviewUtils', () => { expect(result.displayAmountText.text).toEqual(convertAmountToDisplayString(modifiedAmount, currency)); }); - it('shows the canceled status when the report does not already read as approved', () => { + it('does not show the canceled status, because it is reported at the report level instead', () => { const functionArgs = {...basicProps, iouReport: {...basicProps.iouReport, isCancelledIOU: true}, originalTransaction: undefined}; const result = getTransactionPreviewTextAndTranslationPaths(functionArgs); - expect(result.previewStatusText).toContainEqual({translationPath: 'iou.canceled'}); - }); - - it('does not show the canceled status on an approved, unsettled expense report, because it reads as approved instead', () => { - const functionArgs = { - ...basicProps, - iouReport: { - ...basicProps.iouReport, - type: CONST.REPORT.TYPE.EXPENSE, - stateNum: CONST.REPORT.STATE_NUM.APPROVED, - statusNum: CONST.REPORT.STATUS_NUM.APPROVED, - isCancelledIOU: true, - }, - policy: createRandomPolicy(1, CONST.POLICY.TYPE.CORPORATE), - originalTransaction: undefined, - }; - const result = getTransactionPreviewTextAndTranslationPaths(functionArgs); expect(result.previewStatusText).toEqual([]); }); From c34503f935bbd10e8fc5a0a9f68d59febd106c0f Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 20 Aug 2026 23:52:21 +0530 Subject: [PATCH 4/4] trim comments. Signed-off-by: krishna2323 --- .../MoneyRequestReportPreview/ReportPreviewHeader.tsx | 5 ++--- src/libs/TransactionPreviewUtils.ts | 4 ++-- tests/ui/MoneyRequestReportPreview.test.tsx | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx index 0e0f050233c0..4f4e7a3a2992 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx @@ -81,9 +81,8 @@ function ReportPreviewHeader() { const shouldShowReportStatus = !!reportStatus && !!expenseCount; - // A cancelled payment is a report level event that the status badge can't express, so it goes next to the expense count. - // It is skipped once the report reads as approved, because that is the state cancelling returns an approving workspace to and - // the badge already says so - the same precedence the expense preview used before this moved up to the report level. + // The badge can't express a cancelled payment, so it sits next to the expense count - unless the badge already reads "Approved", + // which is the state cancelling returns an approving workspace to. const isApprovedReport = reportStateNum === CONST.REPORT.STATE_NUM.APPROVED && reportStatusNum === CONST.REPORT.STATUS_NUM.APPROVED; const supportingText = iouReport?.isCancelledIOU && !isApprovedReport ? `${translate('iou.canceled')} ${CONST.DOT_SEPARATOR} ${expenseCount}` : expenseCount; diff --git a/src/libs/TransactionPreviewUtils.ts b/src/libs/TransactionPreviewUtils.ts index 5e3e971862c1..7fee7d14525e 100644 --- a/src/libs/TransactionPreviewUtils.ts +++ b/src/libs/TransactionPreviewUtils.ts @@ -326,8 +326,8 @@ function getTransactionPreviewTextAndTranslationPaths({ previewDateText = {text: date}; } - // Paid, Approved, Review required, Canceled and the hold message are intentionally omitted here because the report status badge, - // the report preview header and the RBR row already show them, so repeating them on this line is noise. + // Paid, Approved, Review required, Canceled and the hold message are omitted here: the status badge, the preview header and the + // RBR row already show them. const previewStatusText: TranslationPathOrText[] = []; if (isPending(transaction)) { diff --git a/tests/ui/MoneyRequestReportPreview.test.tsx b/tests/ui/MoneyRequestReportPreview.test.tsx index 7eb25ba3d10b..79e0e3ec05bd 100644 --- a/tests/ui/MoneyRequestReportPreview.test.tsx +++ b/tests/ui/MoneyRequestReportPreview.test.tsx @@ -180,8 +180,8 @@ const getTransactionDisplayAmountAndMetadataText = (transaction: Transaction) => const created = getFormattedCreated(transaction); const date = DateUtils.formatWithUTCTimeZone(created, DateUtils.doesDateBelongToAPastYear(created) ? CONST.DATE.MONTH_DAY_YEAR_ABBR_FORMAT : CONST.DATE.MONTH_DAY_ABBR_FORMAT, undefined); const isTransactionMadeWithCard = isManagedCardTransaction(transaction); - // The supporting line carries the date, then the category and any status. These transactions have neither, so the date is the - // whole line and is asserted exactly - a prefix match would let an unexpected category or status slip through. + // These transactions have no category and no status, so the date is the whole supporting line. Asserted exactly, so an + // unexpected category or status can't slip through. const transactionSupportingText = date; const transactionTypeText = isTransactionMadeWithCard ? TestHelper.translateLocal('iou.card') : TestHelper.translateLocal('iou.cash'); const transactionDisplayAmount = TestHelper.convertToDisplayString(-transaction.amount, transaction.currency);