@@ -100,6 +100,9 @@ const getTransactionDisplayAmountAndHeaderText = (transaction: Transaction) => {
100100} ;
101101
102102const setCurrentWidth = ( ) => {
103+ fireEvent ( screen . getByTestId ( 'MoneyRequestReportPreviewContent-wrapper' ) , 'layout' , {
104+ nativeEvent : { layout : { width : 600 } } ,
105+ } ) ;
103106 fireEvent ( screen . getByTestId ( 'carouselWidthSetter' ) , 'layout' , {
104107 nativeEvent : { layout : { width : 500 } } ,
105108 } ) ;
@@ -147,6 +150,7 @@ describe('MoneyRequestReportPreview', () => {
147150 await waitForBatchedUpdatesWithAct ( ) ;
148151 setCurrentWidth ( ) ;
149152 await Onyx . mergeCollection ( ONYXKEYS . COLLECTION . TRANSACTION , mockOnyxTransactions ) . then ( waitForBatchedUpdates ) ;
153+ await waitForBatchedUpdatesWithAct ( ) ;
150154 const { reportName : moneyRequestReportPreviewName = '' } = mockChatReport ;
151155 for ( const transaction of arrayOfTransactions ) {
152156 const { transactionDisplayAmount, transactionHeaderText} = getTransactionDisplayAmountAndHeaderText ( transaction ) ;
@@ -163,6 +167,7 @@ describe('MoneyRequestReportPreview', () => {
163167 await waitForBatchedUpdatesWithAct ( ) ;
164168 setCurrentWidth ( ) ;
165169 await Onyx . multiSet ( { ...mockOnyxTransactions , ...mockOnyxViolations } ) ;
170+ await waitForBatchedUpdatesWithAct ( ) ;
166171 expect ( screen . getAllByText ( translateLocal ( 'violations.reviewRequired' ) ) ) . toHaveLength ( 2 ) ;
167172 } ) ;
168173
@@ -175,6 +180,6 @@ describe('MoneyRequestReportPreview', () => {
175180 await Onyx . merge ( `${ ONYXKEYS . COLLECTION . TRANSACTION } ${ mockSecondTransactionID } ` , { } as OnyxMergeInput < `transactions_${string } `> ) ;
176181 await waitForBatchedUpdatesWithAct ( ) ;
177182
178- expect ( screen . getAllByTestId ( TransactionPreviewSkeletonView . displayName ) ) . toHaveLength ( 2 ) ;
183+ expect ( screen . getAllByTestId ( ' TransactionPreviewSkeletonView' ) ) . toHaveLength ( 2 ) ;
179184 } ) ;
180185} ) ;
0 commit comments