@@ -885,36 +885,6 @@ 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- } ) ;
918888} ) ;
919889
920890describe ( 'getSecondaryExportReportActions' , ( ) => {
@@ -991,6 +961,30 @@ describe('getSecondaryExportReportActions', () => {
991961 expect ( result . includes ( CONST . REPORT . EXPORT_OPTIONS . EXPORT_TO_INTEGRATION ) ) . toBe ( true ) ;
992962 } ) ;
993963
964+ it ( 'include EXPORT option for settled expense report with integrated policy' , async ( ) => {
965+ const report = {
966+ reportID : REPORT_ID ,
967+ type : CONST . REPORT . TYPE . EXPENSE ,
968+ ownerAccountID : EMPLOYEE_ACCOUNT_ID ,
969+ statusNum : CONST . REPORT . STATUS_NUM . REIMBURSED ,
970+ stateNum : CONST . REPORT . STATE_NUM . APPROVED ,
971+ policyID : POLICY_ID ,
972+ } as unknown as Report ;
973+
974+ const policy = {
975+ connections : {
976+ [ CONST . POLICY . CONNECTIONS . NAME . XERO ] : { } ,
977+ } ,
978+ id : POLICY_ID ,
979+ role : CONST . POLICY . ROLE . ADMIN ,
980+ } as Policy ;
981+
982+ await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ REPORT_ID } ` , report ) ;
983+
984+ const result = getSecondaryExportReportActions ( report , policy ) ;
985+ expect ( result . includes ( CONST . REPORT . EXPORT_OPTIONS . EXPORT_TO_INTEGRATION ) ) . toBe ( true ) ;
986+ } ) ;
987+
994988 it ( 'includes MARK_AS_EXPORTED option for invoice report sender' , async ( ) => {
995989 const report = {
996990 reportID : REPORT_ID ,
0 commit comments