@@ -2338,84 +2338,6 @@ describe('ReportUtils', () => {
23382338 expect ( requiresAttentionFromCurrentUser ( policyExpenseChat ) ) . toBe ( true ) ;
23392339 } ) ;
23402340
2341- it ( 'returns true and surfaces GBR when expense report is awaiting approval by approver-only user' , async ( ) => {
2342- // Given an expense report that is submitted and awaiting approval by the current user (approver-only)
2343- // The current user must be a participant to have access to the report
2344- const report : Report = {
2345- ...LHNTestUtils . getFakeReport ( ) ,
2346- type : CONST . REPORT . TYPE . EXPENSE ,
2347- stateNum : CONST . REPORT . STATE_NUM . SUBMITTED ,
2348- statusNum : CONST . REPORT . STATUS_NUM . SUBMITTED ,
2349- managerID : currentUserAccountID ,
2350- hasParentAccess : false ,
2351- policyID : '1' ,
2352- } ;
2353-
2354- await Onyx . merge ( ONYXKEYS . SESSION , { accountID : currentUserAccountID , email : currentUserEmail } ) ;
2355- await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report . reportID } ` , report ) ;
2356- await waitForBatchedUpdates ( ) ;
2357-
2358- // When we evaluate if the report requires attention from the current user
2359- const requiresAttention = requiresAttentionFromCurrentUser ( report ) ;
2360-
2361- // Then it should return true because the user is the approver and the report needs approval
2362- expect ( requiresAttention ) . toBe ( true ) ;
2363-
2364- // And the reason for the report to be in the option list should be HAS_GBR
2365- const reason = reasonForReportToBeInOptionList ( {
2366- report,
2367- chatReport : report ,
2368- currentReportId : '' ,
2369- isInFocusMode : false ,
2370- betas : [ CONST . BETAS . DEFAULT_ROOMS ] ,
2371- doesReportHaveViolations : false ,
2372- excludeEmptyChats : false ,
2373- draftComment : '' ,
2374- isReportArchived : undefined ,
2375- } ) ;
2376-
2377- expect ( reason ) . toBe ( CONST . REPORT_IN_LHN_REASONS . HAS_GBR ) ;
2378- } ) ;
2379-
2380- it ( 'returns false and does not surface GBR when expense report awaiting approval is for a different approver' , async ( ) => {
2381- // Given an expense report that is submitted but awaiting approval by a different user (not current user)
2382- const differentApproverAccountID = 999999 ;
2383- const report : Report = {
2384- ...LHNTestUtils . getFakeReport ( [ currentUserAccountID , differentApproverAccountID ] ) ,
2385- type : CONST . REPORT . TYPE . EXPENSE ,
2386- stateNum : CONST . REPORT . STATE_NUM . SUBMITTED ,
2387- statusNum : CONST . REPORT . STATUS_NUM . SUBMITTED ,
2388- managerID : differentApproverAccountID ,
2389- hasParentAccess : false ,
2390- policyID : '1' ,
2391- } ;
2392-
2393- await Onyx . merge ( ONYXKEYS . SESSION , { accountID : currentUserAccountID , email : currentUserEmail } ) ;
2394- await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report . reportID } ` , report ) ;
2395- await waitForBatchedUpdates ( ) ;
2396-
2397- // When we evaluate if the report requires attention from the current user
2398- const requiresAttention = requiresAttentionFromCurrentUser ( report ) ;
2399-
2400- // Then it should return false because the current user is not the approver
2401- expect ( requiresAttention ) . toBe ( false ) ;
2402-
2403- // And the reason for the report to be in the option list should not be HAS_GBR
2404- const reason = reasonForReportToBeInOptionList ( {
2405- report,
2406- chatReport : report ,
2407- currentReportId : '' ,
2408- isInFocusMode : false ,
2409- betas : [ CONST . BETAS . DEFAULT_ROOMS ] ,
2410- doesReportHaveViolations : false ,
2411- excludeEmptyChats : false ,
2412- draftComment : '' ,
2413- isReportArchived : undefined ,
2414- } ) ;
2415-
2416- expect ( reason ) . not . toBe ( CONST . REPORT_IN_LHN_REASONS . HAS_GBR ) ;
2417- } ) ;
2418-
24192341 it ( 'returns false and does not surface GBR when expense report is approved and reimbursement is enabled' , async ( ) => {
24202342 // Given a policy with reimbursement enabled
24212343 const policyID = '1' ;
@@ -2430,34 +2352,17 @@ describe('ReportUtils', () => {
24302352 policyID,
24312353 } ;
24322354
2433- await Onyx . merge ( ONYXKEYS . SESSION , { accountID : currentUserAccountID , email : currentUserEmail } ) ;
24342355 await Onyx . merge ( `${ ONYXKEYS . COLLECTION . POLICY } ${ policyID } ` , {
24352356 id : policyID ,
24362357 reimbursementChoice : CONST . POLICY . REIMBURSEMENT_CHOICES . REIMBURSEMENT_MANUAL ,
24372358 } ) ;
2438- await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report . reportID } ` , report ) ;
24392359 await waitForBatchedUpdates ( ) ;
24402360
24412361 // When we evaluate if the report requires attention from the current user
24422362 const requiresAttention = requiresAttentionFromCurrentUser ( report ) ;
24432363
24442364 // Then it should return false because the report is already approved and reimbursement is enabled
24452365 expect ( requiresAttention ) . toBe ( false ) ;
2446-
2447- // And the reason for the report to be in the option list should not be HAS_GBR
2448- const reason = reasonForReportToBeInOptionList ( {
2449- report,
2450- chatReport : report ,
2451- currentReportId : '' ,
2452- isInFocusMode : false ,
2453- betas : [ CONST . BETAS . DEFAULT_ROOMS ] ,
2454- doesReportHaveViolations : false ,
2455- excludeEmptyChats : false ,
2456- draftComment : '' ,
2457- isReportArchived : undefined ,
2458- } ) ;
2459-
2460- expect ( reason ) . not . toBe ( CONST . REPORT_IN_LHN_REASONS . HAS_GBR ) ;
24612366 } ) ;
24622367 } ) ;
24632368
0 commit comments