forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#54107 from FitseTLT/fix-allowing=tax-rec…
…laimable-equal-to-tax-rates
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {validateTaxClaimableValue} from '@libs/PolicyDistanceRatesUtils'; | ||
|
||
describe('PolicyDistanceRatesUtils', () => { | ||
describe('validateTaxClaimableValue', () => { | ||
it('should return an error when taxClaimableValue is equal to tax rate', () => { | ||
// Given a tax claimable value inserted for a distance rate | ||
|
||
// When the taxClaimableValue is equal to the tax rate | ||
const validate = validateTaxClaimableValue({taxClaimableValue: '0.67'}, {rate: 67, customUnitRateID: ''}); | ||
// Then validateTaxClaimableValue will return an error. | ||
expect(validate.taxClaimableValue).toBeDefined(); | ||
|
||
// When the taxClaimableValue is greater than the tax rate | ||
const validate2 = validateTaxClaimableValue({taxClaimableValue: '0.69'}, {rate: 67, customUnitRateID: ''}); | ||
// Then validateTaxClaimableValue will return an error. | ||
expect(validate2.taxClaimableValue).toBeDefined(); | ||
|
||
// When the taxClaimableValue is less than the tax rate | ||
const validate3 = validateTaxClaimableValue({taxClaimableValue: '0.65'}, {rate: 67, customUnitRateID: ''}); | ||
// Then validateTaxClaimableValue will not return an error. | ||
expect(validate3.taxClaimableValue).toBeUndefined(); | ||
}); | ||
}); | ||
}); |