@@ -181,6 +181,35 @@ describe('getReportPreviewAction', () => {
181181
182182 expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , false ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
183183 } ) ;
184+
185+ it ( 'should return false for report with pending expenses' , async ( ) => {
186+ const report = {
187+ ...createRandomReport ( REPORT_ID ) ,
188+ type : CONST . REPORT . TYPE . EXPENSE ,
189+ ownerAccountID : CURRENT_USER_ACCOUNT_ID ,
190+ stateNum : CONST . REPORT . STATE_NUM . SUBMITTED ,
191+ statusNum : CONST . REPORT . STATUS_NUM . SUBMITTED ,
192+ managerID : CURRENT_USER_ACCOUNT_ID ,
193+ isWaitingOnBankAccount : false ,
194+ } ;
195+
196+ const policy = createRandomPolicy ( 0 ) ;
197+ policy . type = CONST . POLICY . TYPE . CORPORATE ;
198+ policy . approver = CURRENT_USER_EMAIL ;
199+ policy . approvalMode = CONST . POLICY . APPROVAL_MODE . BASIC ;
200+ policy . preventSelfApproval = false ;
201+
202+ await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ REPORT_ID } ` , report ) ;
203+ const transaction = {
204+ reportID : `${ REPORT_ID } ` ,
205+ status : CONST . TRANSACTION . STATUS . PENDING ,
206+ amount : 10 ,
207+ merchant : 'Merchant' ,
208+ date : '2025-01-01' ,
209+ } as unknown as Transaction ;
210+
211+ expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , false ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
212+ } ) ;
184213 } ) ;
185214
186215 it ( "canApprove should return true for the current report manager regardless of whether they're in the current approval workflow" , async ( ) => {
0 commit comments