diff --git a/src/libs/TransactionUtils/index.ts b/src/libs/TransactionUtils/index.ts index 69507a651d9f..6f8134a40e9c 100644 --- a/src/libs/TransactionUtils/index.ts +++ b/src/libs/TransactionUtils/index.ts @@ -1104,13 +1104,14 @@ function shouldShowViolation(iouReport: OnyxEntry, policy: OnyxEntry = {}): Transaction { @@ -726,4 +727,24 @@ describe('TransactionUtils', () => { expect(result).toBe(true); }); }); + + describe('shouldShowViolation', () => { + it('should return false for auto approval limit violation when report is not open/processing report', () => { + const iouReport: Report = { + ...createRandomReport(0), + type: CONST.REPORT.TYPE.EXPENSE, + chatType: undefined, + statusNum: CONST.REPORT.STATUS_NUM.APPROVED, + stateNum: CONST.REPORT.STATE_NUM.APPROVED, + ownerAccountID: 2, + }; + + const policy: Policy = { + ...createRandomPolicy(0, CONST.POLICY.TYPE.TEAM), + role: CONST.POLICY.ROLE.ADMIN, + }; + + expect(TransactionUtils.shouldShowViolation(iouReport, policy, CONST.VIOLATIONS.OVER_AUTO_APPROVAL_LIMIT)).toBe(false); + }); + }); });