@@ -1941,7 +1941,7 @@ describe('ReportUtils', () => {
19411941 expenseCreatedAction . childReportID = transactionThreadReport . reportID ;
19421942
19431943 await Onyx . merge ( ONYXKEYS . PERSONAL_DETAILS_LIST , {
1944- currentUserAccountID : {
1944+ [ currentUserAccountID ] : {
19451945 accountID : currentUserAccountID ,
19461946 displayName : currentUserEmail ,
19471947 login : currentUserEmail ,
@@ -5305,6 +5305,30 @@ describe('ReportUtils', () => {
53055305 expect ( getReportStatusTranslation ( undefined , CONST . REPORT . STATUS_NUM . OPEN ) ) . toBe ( '' ) ;
53065306 } ) ;
53075307 } ) ;
5308+
5309+ describe ( 'buildOptimisticReportPreview' , ( ) => {
5310+ it ( 'should include childOwnerAccountID and childManagerAccountID that matches with iouReport data' , ( ) => {
5311+ const chatReport : Report = {
5312+ ...createRandomReport ( 100 ) ,
5313+ type : CONST . REPORT . TYPE . CHAT ,
5314+ chatType : undefined ,
5315+ } ;
5316+
5317+ const iouReport : Report = {
5318+ ...createRandomReport ( 200 ) ,
5319+ parentReportID : '1' ,
5320+ type : CONST . REPORT . TYPE . IOU ,
5321+ chatType : undefined ,
5322+ ownerAccountID : 1 ,
5323+ managerID : 2 ,
5324+ } ;
5325+
5326+ const reportPreviewAction = buildOptimisticReportPreview ( chatReport , iouReport ) ;
5327+
5328+ expect ( reportPreviewAction . childOwnerAccountID ) . toBe ( iouReport . ownerAccountID ) ;
5329+ expect ( reportPreviewAction . childManagerAccountID ) . toBe ( iouReport . managerID ) ;
5330+ } ) ;
5331+ } ) ;
53085332 describe ( 'canSeeDefaultRoom' , ( ) => {
53095333 it ( 'should return true if report is archived room ' , ( ) => {
53105334 const betas = [ CONST . BETAS . DEFAULT_ROOMS ] ;
0 commit comments