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 @@ -5598,7 +5598,7 @@ function getReportName(
55985598 }
55995599
56005600 if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION)) {
5601- return getUnreportedTransactionMessage();
5601+ return Parser.htmlToText( getUnreportedTransactionMessage() );
56025602 }
56035603
56045604 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 @@ -1114,6 +1114,33 @@ describe('ReportUtils', () => {
11141114 ) ;
11151115 } ) ;
11161116 } ) ;
1117+
1118+ describe ( 'Unreported transaction thread' , ( ) => {
1119+ test ( 'HTML is stripped from unreported transaction message' , ( ) => {
1120+ const transactionThread = {
1121+ ...LHNTestUtils . getFakeReport ( ) ,
1122+ type : CONST . REPORT . TYPE . CHAT ,
1123+ reportID : '123' ,
1124+ parentReportID : '456' ,
1125+ } ;
1126+
1127+ const unreportedTransactionAction = {
1128+ actionName : CONST . REPORT . ACTIONS . TYPE . UNREPORTED_TRANSACTION ,
1129+ originalMessage : {
1130+ fromReportID : '789' ,
1131+ } ,
1132+ } as ReportAction ;
1133+
1134+ const reportName = getReportName ( transactionThread , undefined , unreportedTransactionAction ) ;
1135+
1136+ // Should NOT contain HTML tags
1137+ expect ( reportName ) . not . toContain ( '<a href' ) ;
1138+ expect ( reportName ) . not . toContain ( '</a>' ) ;
1139+ // Should contain the text content
1140+ expect ( reportName ) . toContain ( 'moved this expense' ) ;
1141+ expect ( reportName ) . toContain ( 'personal space' ) ;
1142+ } ) ;
1143+ } ) ;
11171144 } ) ;
11181145
11191146 // Need to merge the same tests
You can’t perform that action at this time.
0 commit comments