File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1774,9 +1774,15 @@ describe('actions/Report', () => {
17741774 key : ONYXKEYS . COLLECTION . REPORT ,
17751775 waitForCollectionCallback : true ,
17761776 callback : ( reports ) => {
1777- Onyx . disconnect ( connection ) ;
17781777 const createdReport = reports ?. [ `${ ONYXKEYS . COLLECTION . REPORT } ${ reportID } ` ] ;
17791778 const parentPolicyExpenseChat = reports ?. [ `${ ONYXKEYS . COLLECTION . REPORT } ${ parentReport ?. reportID } ` ] ;
1779+
1780+ // Wait until the optimistic data has propagated
1781+ if ( ! createdReport ?. reportID || parentPolicyExpenseChat ?. hasOutstandingChildRequest !== true ) {
1782+ return ;
1783+ }
1784+
1785+ Onyx . disconnect ( connection ) ;
17801786 // assert correctness of crucial onyx data
17811787 expect ( createdReport ?. reportID ) . toBe ( reportID ) ;
17821788 expect ( parentPolicyExpenseChat ?. hasOutstandingChildRequest ) . toBe ( true ) ;
You can’t perform that action at this time.
0 commit comments