@@ -8888,44 +8888,6 @@ describe('actions/IOU', () => {
88888888 expect ( updatedReport ?. stateNum ) . toBe ( CONST . REPORT . STATE_NUM . SUBMITTED ) ;
88898889 expect ( updatedReport ?. statusNum ) . toBe ( CONST . REPORT . STATUS_NUM . SUBMITTED ) ;
88908890 } ) ;
8891-
8892- it ( 'should handle take control with SUBMITTED_AND_CLOSED action invalidation' , async ( ) => {
8893- // Admin takes control
8894- const takeControlAction = {
8895- reportActionID : 'takeControl7' ,
8896- actionName : CONST . REPORT . ACTIONS . TYPE . TAKE_CONTROL ,
8897- actorAccountID : adminAccountID ,
8898- created : '2023-01-01T10:00:00.000Z' ,
8899- } ;
8900-
8901- // Employee submits and closes after take control (invalidates it)
8902- const submittedAndClosedAction = {
8903- reportActionID : 'submittedClosed1' ,
8904- actionName : CONST . REPORT . ACTIONS . TYPE . SUBMITTED_AND_CLOSED ,
8905- actorAccountID : employeeAccountID ,
8906- created : '2023-01-01T11:00:00.000Z' , // After take control
8907- } ;
8908-
8909- await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ expenseReport . reportID } ` , {
8910- [ takeControlAction . reportActionID ] : takeControlAction ,
8911- [ submittedAndClosedAction . reportActionID ] : submittedAndClosedAction ,
8912- } ) ;
8913-
8914- // Set session as manager (normal approver)
8915- await Onyx . set ( ONYXKEYS . SESSION , {
8916- email : managerEmail ,
8917- accountID : managerAccountID ,
8918- } ) ;
8919-
8920- // Manager approves the report
8921- approveMoneyRequest ( expenseReport ) ;
8922- await waitForBatchedUpdates ( ) ;
8923-
8924- // Should be submitted to admin (normal flow) since take control was invalidated
8925- const updatedReport = await getOnyxValue ( `${ ONYXKEYS . COLLECTION . REPORT } ${ expenseReport . reportID } ` ) ;
8926- expect ( updatedReport ?. stateNum ) . toBe ( CONST . REPORT . STATE_NUM . SUBMITTED ) ;
8927- expect ( updatedReport ?. statusNum ) . toBe ( CONST . REPORT . STATUS_NUM . SUBMITTED ) ;
8928- } ) ;
89298891 } ) ;
89308892
89318893 describe ( 'approveMoneyRequest with normal approval chain' , ( ) => {
@@ -8974,18 +8936,18 @@ describe('actions/IOU', () => {
89748936 employeeList : {
89758937 [ employeeEmail ] : {
89768938 email : employeeEmail ,
8977- role : 'user' ,
8939+ role : CONST . POLICY . ROLE . USER ,
89788940 submitsTo : managerEmail ,
89798941 } ,
89808942 [ managerEmail ] : {
89818943 email : managerEmail ,
8982- role : 'user' ,
8944+ role : CONST . POLICY . ROLE . USER ,
89838945 submitsTo : adminEmail ,
89848946 forwardsTo : adminEmail ,
89858947 } ,
89868948 [ adminEmail ] : {
89878949 email : adminEmail ,
8988- role : 'admin' ,
8950+ role : CONST . POLICY . ROLE . ADMIN ,
89898951 submitsTo : '' ,
89908952 forwardsTo : '' ,
89918953 } ,
0 commit comments