From 5500d08755b9be712174ec90628638c01d6ecf53 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Mon, 19 Feb 2024 10:52:44 +0100 Subject: [PATCH] fix lint --- main/test/utils.test.js | 7 +++++++ main/test/wallet.test.js | 2 ++ 2 files changed, 9 insertions(+) diff --git a/main/test/utils.test.js b/main/test/utils.test.js index 44f3ad61a..c50fa5d7a 100644 --- a/main/test/utils.test.js +++ b/main/test/utils.test.js @@ -10,6 +10,7 @@ describe('formatTokenValue', function () { const result = formatTokenValue(input) assert.equal(result, expectedOutput) }) + it('should reduce a big number to 6 decimal places', function () { const input = 123.45678923456 @@ -17,6 +18,7 @@ describe('formatTokenValue', function () { const result = formatTokenValue(input) assert.equal(result, expectedOutput) }) + it('should reduce a very small number to 6 decimal places', function () { const input = 0.000123456789 @@ -24,24 +26,28 @@ describe('formatTokenValue', function () { const result = formatTokenValue(input) assert.equal(result, expectedOutput) }) + it('should round up', function () { const input = 0.0001289 const expectedOutput = 0.000129 const result = formatTokenValue(input) assert.equal(result, expectedOutput) }) + it('should map 0 to 0', function () { const input = 0 const expectedOutput = 0 const result = formatTokenValue(input) assert.equal(result, expectedOutput) }) + it('should leave a big integer alone', function () { const input = 123456789 const expectedOutput = 123456789 const result = formatTokenValue(input) assert.equal(result, expectedOutput) }) + it('should show 6 decimal places for numbers smaller than 0.000001', function () { const input = 0.000000000123456789 @@ -49,6 +55,7 @@ describe('formatTokenValue', function () { const result = formatTokenValue(input) assert.equal(result, expectedOutput) }) + it('should not add zeroes to a number that is has no trailing zeroes', function () { const input = 123.4 diff --git a/main/test/wallet.test.js b/main/test/wallet.test.js index 66ede7507..1f59e90e7 100644 --- a/main/test/wallet.test.js +++ b/main/test/wallet.test.js @@ -72,6 +72,7 @@ describe('Wallet', function () { ] ) }) + it('lists only processing transactions', function () { assert.deepStrictEqual( getTransactionsForUI([ @@ -84,6 +85,7 @@ describe('Wallet', function () { ] ) }) + it('lists only succeeded transactions', function () { assert.deepStrictEqual( getTransactionsForUI([