@@ -1720,14 +1720,12 @@ describe('actions/IOU', () => {
17201720 const linkedTrackedExpenseReportAction = actions . find ( ( action ) => action && isMoneyRequestAction ( action ) ) ;
17211721 const actionableWhisperReportActionID = actions . find ( ( action ) => action && isActionableTrackExpense ( action ) ) ?. reportActionID ;
17221722
1723- let transactionID : string | undefined ;
17241723 let linkedTrackedExpenseReportID : string | undefined ;
17251724 await getOnyxData ( {
17261725 key : ONYXKEYS . COLLECTION . TRANSACTION ,
17271726 waitForCollectionCallback : true ,
17281727 callback : ( allTransactions ) => {
17291728 const transaction = Object . values ( allTransactions ?? { } ) . find ( ( t ) => ! isEmptyObject ( t ) ) ;
1730- transactionID = transaction ?. transactionID ;
17311729 linkedTrackedExpenseReportID = transaction ?. reportID ;
17321730 } ,
17331731 } ) ;
@@ -1763,57 +1761,6 @@ describe('actions/IOU', () => {
17631761 } ) ;
17641762 await waitForBatchedUpdates ( ) ;
17651763
1766- // Verify optimistic data is created with pending status
1767- let policyExpenseChatReportID : string | undefined ;
1768- let moneyRequestReportID : string | undefined ;
1769- let policyExpenseChatOnyx : Report | undefined ;
1770- let moneyRequestReport : Report | undefined ;
1771- await getOnyxData ( {
1772- key : ONYXKEYS . COLLECTION . REPORT ,
1773- waitForCollectionCallback : true ,
1774- callback : ( allReportsAfterShare ) => {
1775- const reportsAfterShare = Object . values ( allReportsAfterShare ?? { } ) ;
1776-
1777- // Find the policy expense chat and money request report
1778- policyExpenseChatOnyx = reportsAfterShare . find ( ( report ) => report ?. reportID === policyExpenseChat . reportID ) ;
1779- moneyRequestReport = reportsAfterShare . find ( ( report ) => report ?. type === CONST . REPORT . TYPE . IOU ) ;
1780-
1781- policyExpenseChatReportID = policyExpenseChatOnyx ?. reportID ;
1782- moneyRequestReportID = moneyRequestReport ?. reportID ;
1783- } ,
1784- } ) ;
1785-
1786- // Verify accountant was added to the expense chat
1787- expect ( policyExpenseChatOnyx ?. participants ?. [ accountant . accountID ] ) . toBeTruthy ( ) ;
1788-
1789- // Verify money request report was created
1790- expect ( moneyRequestReport ) . toBeTruthy ( ) ;
1791- expect ( moneyRequestReport ?. type ) . toBe ( CONST . REPORT . TYPE . IOU ) ;
1792-
1793- // Verify money request report actions are pending
1794- const moneyRequestReportActions = await getOnyxValue ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ moneyRequestReportID } ` ) ;
1795- const moneyRequestActions = Object . values ( moneyRequestReportActions ?? { } ) ;
1796- const createdAction = moneyRequestActions . find ( ( action ) => action && action . actionName === CONST . REPORT . ACTIONS . TYPE . CREATED ) ;
1797- const iouAction = moneyRequestActions . find ( ( action ) => action && isMoneyRequestAction ( action ) ) ;
1798-
1799- // Both actions should be pending
1800- expect ( createdAction ?. pendingAction ) . toBe ( CONST . RED_BRICK_ROAD_PENDING_ACTION . ADD ) ;
1801- expect ( iouAction ?. pendingAction ) . toBe ( CONST . RED_BRICK_ROAD_PENDING_ACTION . ADD ) ;
1802-
1803- // Verify policy expense chat report preview is pending
1804- const policyExpenseChatActions = await getOnyxValue ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ policyExpenseChatReportID } ` ) ;
1805- const policyExpenseActions = Object . values ( policyExpenseChatActions ?? { } ) ;
1806- const reportPreviewAction = policyExpenseActions . find ( ( action ) => action && action . actionName === CONST . REPORT . ACTIONS . TYPE . REPORT_PREVIEW ) ;
1807-
1808- // Report preview should be pending
1809- expect ( reportPreviewAction ?. pendingAction ) . toBe ( CONST . RED_BRICK_ROAD_PENDING_ACTION . ADD ) ;
1810-
1811- // Verify transaction is pending
1812- const transactionData = await getOnyxValue ( `${ ONYXKEYS . COLLECTION . TRANSACTION } ${ transactionID } ` ) ;
1813-
1814- // Transaction should be pending
1815- expect ( transactionData ?. pendingAction ) . toBe ( CONST . RED_BRICK_ROAD_PENDING_ACTION . ADD ) ;
1816-
18171764 // Simulate network failure
18181765 mockFetch ?. fail ?.( ) ;
18191766 await ( mockFetch ?. resume ?.( ) as Promise < unknown > ) ;
0 commit comments