@@ -68,7 +68,7 @@ describe('getReportPreviewAction', () => {
6868 } as unknown as Report ;
6969 await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ REPORT_ID } ` , report ) ;
7070
71- expect ( getReportPreviewAction ( VIOLATIONS , report , undefined , [ ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . ADD_EXPENSE ) ;
71+ expect ( getReportPreviewAction ( VIOLATIONS , false , report , undefined , [ ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . ADD_EXPENSE ) ;
7272 } ) ;
7373
7474 it ( 'canSubmit should return true for expense preview report with manual submit' , async ( ) => {
@@ -94,7 +94,7 @@ describe('getReportPreviewAction', () => {
9494
9595 // Simulate how components use a hook to pass the isReportArchived parameter
9696 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
97- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . SUBMIT ) ;
97+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . SUBMIT ) ;
9898 } ) ;
9999
100100 it ( 'canSubmit should return false for expense preview report with only pending transactions' , async ( ) => {
@@ -124,7 +124,7 @@ describe('getReportPreviewAction', () => {
124124
125125 // Simulate how components use a hook to pass the isReportArchived parameter
126126 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
127- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
127+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
128128 } ) ;
129129
130130 describe ( 'canApprove' , ( ) => {
@@ -151,7 +151,7 @@ describe('getReportPreviewAction', () => {
151151 } as unknown as Transaction ;
152152
153153 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
154- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . APPROVE ) ;
154+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . APPROVE ) ;
155155 } ) ;
156156
157157 it ( 'should return false for report with scanning expenses' , async ( ) => {
@@ -179,7 +179,7 @@ describe('getReportPreviewAction', () => {
179179 } ,
180180 } as unknown as Transaction ;
181181
182- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , false ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
182+ expect ( getReportPreviewAction ( VIOLATIONS , false , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
183183 } ) ;
184184
185185 it ( 'should return false for report with pending expenses' , async ( ) => {
@@ -208,7 +208,7 @@ describe('getReportPreviewAction', () => {
208208 date : '2025-01-01' ,
209209 } as unknown as Transaction ;
210210
211- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , false ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
211+ expect ( getReportPreviewAction ( VIOLATIONS , false , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
212212 } ) ;
213213 } ) ;
214214
@@ -235,7 +235,7 @@ describe('getReportPreviewAction', () => {
235235 } as unknown as Transaction ;
236236
237237 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
238- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . APPROVE ) ;
238+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . APPROVE ) ;
239239 } ) ;
240240
241241 it ( 'canPay should return true for expense report with payments enabled' , async ( ) => {
@@ -259,7 +259,7 @@ describe('getReportPreviewAction', () => {
259259 } as unknown as Transaction ;
260260
261261 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
262- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . PAY ) ;
262+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . PAY ) ;
263263 } ) ;
264264
265265 it ( 'canPay should return true for submitted invoice' , async ( ) => {
@@ -287,7 +287,7 @@ describe('getReportPreviewAction', () => {
287287 } as unknown as Transaction ;
288288
289289 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
290- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current , undefined , invoiceReceiverPolicy ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . PAY ) ;
290+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] , undefined , invoiceReceiverPolicy ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . PAY ) ;
291291 } ) ;
292292
293293 it ( 'getReportPreviewAction should return VIEW action for zero value invoice' , async ( ) => {
@@ -332,7 +332,7 @@ describe('getReportPreviewAction', () => {
332332
333333 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report . parentReportID ) ) ;
334334
335- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current , undefined , invoiceReceiverPolicy ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
335+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] , undefined , invoiceReceiverPolicy ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
336336 } ) ;
337337
338338 it ( 'canPay should return false for archived invoice' , async ( ) => {
@@ -364,7 +364,7 @@ describe('getReportPreviewAction', () => {
364364 reportID : `${ REPORT_ID } ` ,
365365 } as unknown as Transaction ;
366366 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
367- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current , undefined , invoiceReceiverPolicy ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . PAY ) ;
367+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] , undefined , invoiceReceiverPolicy ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . PAY ) ;
368368 } ) ;
369369
370370 it ( 'getReportPreviewAction should return VIEW action for invoice when the chat report is archived' , async ( ) => {
@@ -392,7 +392,7 @@ describe('getReportPreviewAction', () => {
392392 const { result : isChatReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. chatReportID ) ) ;
393393
394394 // Then the getReportPreviewAction should return the View action
395- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isChatReportArchived . current , undefined ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
395+ expect ( getReportPreviewAction ( VIOLATIONS , isChatReportArchived . current , report , policy , [ transaction ] , undefined ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
396396 } ) ;
397397
398398 it ( 'canExport should return true for finished reports' , async ( ) => {
@@ -414,7 +414,7 @@ describe('getReportPreviewAction', () => {
414414 } as unknown as Transaction ;
415415
416416 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
417- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . EXPORT_TO_ACCOUNTING ) ;
417+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . EXPORT_TO_ACCOUNTING ) ;
418418 } ) ;
419419
420420 it ( 'canReview should return true for reports where there are violations, user is submitter or approver and Workflows are enabled' , async ( ) => {
@@ -448,7 +448,7 @@ describe('getReportPreviewAction', () => {
448448 } as unknown as Transaction ;
449449
450450 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
451- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . REVIEW ) ;
451+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . REVIEW ) ;
452452 } ) ;
453453
454454 it ( 'canReview should return true for reports with RTER violations regardless of workspace workflow configuration' , async ( ) => {
@@ -485,7 +485,7 @@ describe('getReportPreviewAction', () => {
485485 reportID : `${ REPORT_ID } ` ,
486486 } as unknown as Transaction ;
487487
488- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . REVIEW ) ;
488+ expect ( getReportPreviewAction ( VIOLATIONS , false , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . REVIEW ) ;
489489 } ) ;
490490
491491 it ( 'canView should return true for reports in which we are waiting for user to add a bank account' , async ( ) => {
@@ -507,6 +507,6 @@ describe('getReportPreviewAction', () => {
507507 } as unknown as Transaction ;
508508
509509 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( report ?. parentReportID ) ) ;
510- expect ( getReportPreviewAction ( VIOLATIONS , report , policy , [ transaction ] , isReportArchived . current ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
510+ expect ( getReportPreviewAction ( VIOLATIONS , isReportArchived . current , report , policy , [ transaction ] ) ) . toBe ( CONST . REPORT . REPORT_PREVIEW_ACTIONS . VIEW ) ;
511511 } ) ;
512512} ) ;
0 commit comments