@@ -991,6 +991,36 @@ describe('getSecondaryAction', () => {
991991 const result = getSecondaryReportActions ( { report, chatReport, reportTransactions : [ transaction ] , violations : { } , policy} ) ;
992992 expect ( result . includes ( CONST . REPORT . SECONDARY_ACTIONS . DELETE ) ) . toBe ( false ) ;
993993 } ) ;
994+
995+ it ( 'include EXPORT_TO_ACCOUNTING option for settled expense report' , async ( ) => {
996+ const report = {
997+ reportID : REPORT_ID ,
998+ type : CONST . REPORT . TYPE . EXPENSE ,
999+ ownerAccountID : EMPLOYEE_ACCOUNT_ID ,
1000+ statusNum : CONST . REPORT . STATUS_NUM . REIMBURSED ,
1001+ stateNum : CONST . REPORT . STATE_NUM . APPROVED ,
1002+ policyID : POLICY_ID ,
1003+ } as unknown as Report ;
1004+
1005+ const TRANSACTION_ID = 'TRANSACTION_ID' ;
1006+ const transaction = {
1007+ transactionID : TRANSACTION_ID ,
1008+ reportID : REPORT_ID ,
1009+ } as unknown as Transaction ;
1010+
1011+ const policy = {
1012+ connections : {
1013+ [ CONST . POLICY . CONNECTIONS . NAME . XERO ] : { } ,
1014+ } ,
1015+ id : POLICY_ID ,
1016+ role : CONST . POLICY . ROLE . ADMIN ,
1017+ } as Policy ;
1018+
1019+ await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ REPORT_ID } ` , report ) ;
1020+
1021+ const result = getSecondaryReportActions ( { report, chatReport, reportTransactions : [ transaction ] , violations : { } , policy} ) ;
1022+ expect ( result . includes ( CONST . REPORT . SECONDARY_ACTIONS . EXPORT_TO_ACCOUNTING ) ) . toBe ( true ) ;
1023+ } ) ;
9941024} ) ;
9951025
9961026describe ( 'getSecondaryTransactionThreadActions' , ( ) => {
0 commit comments