Skip to content

Commit 2157dd0

Browse files
MelvinBotsituchan
andcommitted
Fix: Update non-reimbursable badge test to use different managerID
After merging main, canApproveIOU now receives currentUserAccountID explicitly. The test was setting managerID to RORY_ACCOUNT_ID and passing the same ID as currentUserAccountID, causing canApproveIOU to return true and the APPROVE badge to appear. Use a different managerID so the test isolates the non-reimbursable PAY badge skip behavior. Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
1 parent 4c47e3e commit 2157dd0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/actions/IOUTest/ReportWorkflowTest.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,15 +3682,16 @@ describe('actions/IOU/ReportWorkflow', () => {
36823682
// Non-reimbursable-only report: total=0, nonReimbursableTotal=-5000
36833683
// canBePaidNow returns false (REIMBURSEMENT_NO early-exits when onlyShowPayElsewhere=false)
36843684
// canBePaidElsewhere returns true (SUBMITTED status + non-reimbursable spend)
3685-
// But since all transactions are non-reimbursable, PAY badge should be skipped
3685+
// But since all transactions are non-reimbursable, PAY badge should be skipped.
3686+
// Use a different managerID so canApproveIOU also returns false (current user is not the manager).
36863687
const fakeIouReport: Report = {
36873688
...createRandomReport(Number(iouReportID), CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT),
36883689
reportID: iouReportID,
36893690
type: CONST.REPORT.TYPE.EXPENSE,
36903691
policyID,
36913692
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
36923693
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
3693-
managerID: RORY_ACCOUNT_ID,
3694+
managerID: 999999,
36943695
total: 0,
36953696
nonReimbursableTotal: -5000,
36963697
isWaitingOnBankAccount: false,

0 commit comments

Comments
 (0)