@@ -6,13 +6,7 @@ import {actionR14932 as mockIOUAction, originalMessageR14932 as mockOriginalMess
66import { chatReportR14932 as mockChatReport , iouReportR14932 as mockIOUReport } from '../../__mocks__/reportData/reports' ;
77import CONST from '../../src/CONST' ;
88import * as ReportActionsUtils from '../../src/libs/ReportActionsUtils' ;
9- import {
10- getOneTransactionThreadReportID ,
11- getOriginalMessage ,
12- getSendMoneyFlowOneTransactionThreadID ,
13- isIOUActionMatchingTransactionList ,
14- isMessageDeleted ,
15- } from '../../src/libs/ReportActionsUtils' ;
9+ import { getOneTransactionThreadReportID , getOriginalMessage , getSendMoneyFlowOneTransactionThreadID , isIOUActionMatchingTransactionList } from '../../src/libs/ReportActionsUtils' ;
1610import ONYXKEYS from '../../src/ONYXKEYS' ;
1711import type { Report , ReportAction } from '../../src/types/onyx' ;
1812import createRandomReport from '../utils/collections/reports' ;
@@ -821,108 +815,6 @@ describe('ReportActionsUtils', () => {
821815 } ) ;
822816 } ) ;
823817
824- describe ( 'isMessageDeleted' , ( ) => {
825- it ( 'should return true if there is property deleted inside message' , ( ) => {
826- const reportAction = {
827- created : '2025-05-12 17:27:01.825' ,
828- reportActionID : '8401445780099176' ,
829- actionName : CONST . REPORT . ACTIONS . TYPE . ADD_COMMENT ,
830- originalMessage : {
831- html : 'Hello world' ,
832- whisperedTo : [ ] ,
833- } ,
834- message : [
835- {
836- html : 'Hello world' ,
837- deleted : '2025-05-12 17:37:01.825' ,
838- type : CONST . REPORT . MESSAGE . TYPE . COMMENT ,
839- text : '' ,
840- } ,
841- ] ,
842- } ;
843- expect ( isMessageDeleted ( reportAction ) ) . toBeTruthy ( ) ;
844- } ) ;
845- it ( 'should return true if there is property isDeletedParentAction inside message' , ( ) => {
846- const reportAction = {
847- created : '2025-05-12 17:27:01.825' ,
848- reportActionID : '8401445780099176' ,
849- actionName : CONST . REPORT . ACTIONS . TYPE . ADD_COMMENT ,
850- originalMessage : {
851- html : 'Hello world' ,
852- whisperedTo : [ ] ,
853- } ,
854- message : [
855- {
856- html : 'Hello world' ,
857- isDeletedParentAction : true ,
858- type : CONST . REPORT . MESSAGE . TYPE . COMMENT ,
859- text : '' ,
860- } ,
861- ] ,
862- } ;
863- expect ( isMessageDeleted ( reportAction ) ) . toBeTruthy ( ) ;
864- } ) ;
865- it ( 'should return true if there is property deleted inside original message' , ( ) => {
866- const reportAction = {
867- created : '2025-05-12 17:27:01.825' ,
868- reportActionID : '8401445780099176' ,
869- actionName : CONST . REPORT . ACTIONS . TYPE . ADD_COMMENT ,
870- originalMessage : {
871- html : 'Hello world' ,
872- whisperedTo : [ ] ,
873- deleted : '2025-05-12 17:37:01.825' ,
874- } ,
875- message : [
876- {
877- html : 'Hello world' ,
878- type : CONST . REPORT . MESSAGE . TYPE . COMMENT ,
879- text : '' ,
880- } ,
881- ] ,
882- } ;
883- expect ( isMessageDeleted ( reportAction ) ) . toBeTruthy ( ) ;
884- } ) ;
885- it ( 'should return true if there is property isDeletedParentAction inside original message' , ( ) => {
886- const reportAction = {
887- created : '2025-05-12 17:27:01.825' ,
888- reportActionID : '8401445780099176' ,
889- actionName : CONST . REPORT . ACTIONS . TYPE . ADD_COMMENT ,
890- originalMessage : {
891- html : 'Hello world' ,
892- whisperedTo : [ ] ,
893- isDeletedParentAction : true ,
894- } ,
895- message : [
896- {
897- html : 'Hello world' ,
898- type : CONST . REPORT . MESSAGE . TYPE . COMMENT ,
899- text : '' ,
900- } ,
901- ] ,
902- } ;
903- expect ( isMessageDeleted ( reportAction ) ) . toBeTruthy ( ) ;
904- } ) ;
905- it ( 'should return false if there are no deletion properties in message and originalMessage' , ( ) => {
906- const reportAction = {
907- created : '2025-05-12 17:27:01.825' ,
908- reportActionID : '8401445780099176' ,
909- actionName : CONST . REPORT . ACTIONS . TYPE . ADD_COMMENT ,
910- originalMessage : {
911- html : 'Hello world' ,
912- whisperedTo : [ ] ,
913- } ,
914- message : [
915- {
916- html : 'Hello world' ,
917- type : CONST . REPORT . MESSAGE . TYPE . COMMENT ,
918- text : '' ,
919- } ,
920- ] ,
921- } ;
922- expect ( isMessageDeleted ( reportAction ) ) . toBeFalsy ( ) ;
923- } ) ;
924- } ) ;
925-
926818 describe ( 'getReportActionMessageFragments' , ( ) => {
927819 it ( 'should return the correct fragment for the REIMBURSED action' , ( ) => {
928820 const action = {
@@ -961,22 +853,6 @@ describe('ReportActionsUtils', () => {
961853 const expectedFragments = ReportActionsUtils . getReportActionMessageFragments ( action ) ;
962854 expect ( expectedFragments ) . toEqual ( [ { text : expectedMessage , html : `<muted-text>${ expectedMessage } </muted-text>` , type : 'COMMENT' } ] ) ;
963855 } ) ;
964- it ( 'should return the correct fragment for the deleted message' , ( ) => {
965- const action = {
966- actionName : CONST . REPORT . ACTIONS . TYPE . ADD_COMMENT ,
967- reportActionID : '1' ,
968- created : '1' ,
969- message : [
970- {
971- type : CONST . REPORT . MESSAGE . TYPE . COMMENT ,
972- text : '' ,
973- deleted : '2025-05-12 17:27:01.825' ,
974- } ,
975- ] ,
976- } ;
977- const expectedFragments = ReportActionsUtils . getReportActionMessageFragments ( action ) ;
978- expect ( expectedFragments ) . toEqual ( [ { text : '' , type : CONST . REPORT . MESSAGE . TYPE . COMMENT , isDeletedParentAction : true , deleted : '2025-05-12 17:27:01.825' } ] ) ;
979- } ) ;
980856 } ) ;
981857
982858 describe ( 'getSendMoneyFlowOneTransactionThreadID' , ( ) => {
0 commit comments