File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -5581,7 +5581,7 @@ function getReportName(
55815581 }
55825582
55835583 if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION)) {
5584- return getUnreportedTransactionMessage();
5584+ return Parser.htmlToText( getUnreportedTransactionMessage() );
55855585 }
55865586
55875587 if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT)) {
Original file line number Diff line number Diff line change @@ -1086,6 +1086,33 @@ describe('ReportUtils', () => {
10861086 ) ;
10871087 } ) ;
10881088 } ) ;
1089+
1090+ describe ( 'Unreported transaction thread' , ( ) => {
1091+ test ( 'HTML is stripped from unreported transaction message' , ( ) => {
1092+ const transactionThread = {
1093+ ...LHNTestUtils . getFakeReport ( ) ,
1094+ type : CONST . REPORT . TYPE . CHAT ,
1095+ reportID : '123' ,
1096+ parentReportID : '456' ,
1097+ } ;
1098+
1099+ const unreportedTransactionAction = {
1100+ actionName : CONST . REPORT . ACTIONS . TYPE . UNREPORTED_TRANSACTION ,
1101+ originalMessage : {
1102+ fromReportID : '789' ,
1103+ } ,
1104+ } as ReportAction ;
1105+
1106+ const reportName = getReportName ( transactionThread , undefined , unreportedTransactionAction ) ;
1107+
1108+ // Should NOT contain HTML tags
1109+ expect ( reportName ) . not . toContain ( '<a href' ) ;
1110+ expect ( reportName ) . not . toContain ( '</a>' ) ;
1111+ // Should contain the text content
1112+ expect ( reportName ) . toContain ( 'moved this expense' ) ;
1113+ expect ( reportName ) . toContain ( 'personal space' ) ;
1114+ } ) ;
1115+ } ) ;
10891116 } ) ;
10901117
10911118 // Need to merge the same tests
You can’t perform that action at this time.
0 commit comments