Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Fix and update discount tier tests (#2598)
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadV91 authored Mar 28, 2022
1 parent f40a576 commit 0b4cf6f
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions src/custom/components/CowSubsidyModal/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,29 @@ import { getDiscountFromBalance } from './utils'
const BALANCES_IN_TIER = [
{ balance: '0', tier: 0 },
{ balance: '100000000000000000', tier: 0 }, // 0.1
{ balance: '99990000000000000000', tier: 0 }, // 99.99
{ balance: '100000000000000000000', tier: 1 }, // 100
{ balance: '100001000000000000000', tier: 1 }, // 100.001
{ balance: '1500000000000000000000', tier: 2 }, // 1500
{ balance: '11000000000000000000000', tier: 3 }, // 11000
{ balance: '174330000000000000000000', tier: 4 }, // 174330
{ balance: '999990000000000000000', tier: 0 }, // 999.99
{ balance: '1000000000000000000000', tier: 1 }, // 1,000
{ balance: '9999990000000000000000', tier: 1 }, // 9,999.99
{ balance: '10000000000000000000000', tier: 2 }, // 10,000
{ balance: '99999990000000000000000', tier: 2 }, // 99,999.99
{ balance: '110000000000000000000000', tier: 3 }, // 110,000
{ balance: '999999990000000000000000', tier: 3 }, // 999,999.99
{ balance: '1743300000000000000000000', tier: 4 }, // 1,743,300
{ balance: '99999999990000000000000000', tier: 4 }, // 99,999,999.99
]

const INCORRECT_BALANCES_IN_TIER = [
{ balance: '0', tier: 2 },
{ balance: '100000000000000000', tier: 4 }, // 0.1
{ balance: '99990000000000000000', tier: 2 }, // 99.99
{ balance: '100000000000000000000', tier: 2 }, // 100
{ balance: '150000000000000000000', tier: 0 }, // 150
{ balance: '1500000000000000000000', tier: 4 }, // 1500
{ balance: '174330000000000000000000', tier: 3 }, // 174330
{ balance: '0', tier: 1 },
{ balance: '100000000000000000', tier: 1 }, // 0.1
{ balance: '999990000000000000000', tier: 1 }, // 999.99
{ balance: '1000000000000000000000', tier: 0 }, // 1,000
{ balance: '9999990000000000000000', tier: 2 }, // 9,999.99
{ balance: '10000000000000000000000', tier: 1 }, // 10,000
{ balance: '99999990000000000000000', tier: 3 }, // 99,999.99
{ balance: '110000000000000000000000', tier: 2 }, // 110,000
{ balance: '999999990000000000000000', tier: 4 }, // 999,999.99
{ balance: '1743300000000000000000000', tier: 3 }, // 1,743,300
{ balance: '99999999990000000000000000', tier: 5 }, // 99,999,999.99
]

describe('FEE DISCOUNT TIERS', () => {
Expand Down

0 comments on commit 0b4cf6f

Please sign in to comment.