@@ -885,6 +885,36 @@ describe('getSecondaryAction', () => {
885885 const result = getSecondaryReportActions ( { report, chatReport, reportTransactions : [ transaction ] , violations : { } , policy} ) ;
886886 expect ( result . includes ( CONST . REPORT . SECONDARY_ACTIONS . DELETE ) ) . toBe ( false ) ;
887887 } ) ;
888+
889+ it ( 'include EXPORT_TO_ACCOUNTING option for settled expense report' , async ( ) => {
890+ const report = {
891+ reportID : REPORT_ID ,
892+ type : CONST . REPORT . TYPE . EXPENSE ,
893+ ownerAccountID : EMPLOYEE_ACCOUNT_ID ,
894+ statusNum : CONST . REPORT . STATUS_NUM . REIMBURSED ,
895+ stateNum : CONST . REPORT . STATE_NUM . APPROVED ,
896+ policyID : POLICY_ID ,
897+ } as unknown as Report ;
898+
899+ const TRANSACTION_ID = 'TRANSACTION_ID' ;
900+ const transaction = {
901+ transactionID : TRANSACTION_ID ,
902+ reportID : REPORT_ID ,
903+ } as unknown as Transaction ;
904+
905+ const policy = {
906+ connections : {
907+ [ CONST . POLICY . CONNECTIONS . NAME . XERO ] : { } ,
908+ } ,
909+ id : POLICY_ID ,
910+ role : CONST . POLICY . ROLE . ADMIN ,
911+ } as Policy ;
912+
913+ await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ REPORT_ID } ` , report ) ;
914+
915+ const result = getSecondaryReportActions ( { report, chatReport, reportTransactions : [ transaction ] , violations : { } , policy} ) ;
916+ expect ( result . includes ( CONST . REPORT . SECONDARY_ACTIONS . EXPORT_TO_ACCOUNTING ) ) . toBe ( true ) ;
917+ } ) ;
888918} ) ;
889919
890920describe ( 'getSecondaryExportReportActions' , ( ) => {
0 commit comments