From b353fba9220e8bc4979d72fd4fbe5fd1bd3428c5 Mon Sep 17 00:00:00 2001 From: nenadV91 Date: Mon, 28 Mar 2022 12:19:54 +0200 Subject: [PATCH] Fix and update discount tier tests --- .../components/CowSubsidyModal/utils.test.ts | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/custom/components/CowSubsidyModal/utils.test.ts b/src/custom/components/CowSubsidyModal/utils.test.ts index 4e12a85bc..6789fe066 100644 --- a/src/custom/components/CowSubsidyModal/utils.test.ts +++ b/src/custom/components/CowSubsidyModal/utils.test.ts @@ -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', () => {