Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Feb 19, 2024
1 parent 3d62bfb commit 5500d08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main/test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,52 @@ 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
const expectedOutput = 123.456789
const result = formatTokenValue(input)
assert.equal(result, expectedOutput)
})

it('should reduce a very small number to 6 decimal places',
function () {
const input = 0.000123456789
const expectedOutput = 0.000123
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
const expectedOutput = 0.000000
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
Expand Down
2 changes: 2 additions & 0 deletions main/test/wallet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ describe('Wallet', function () {
]
)
})

it('lists only processing transactions', function () {
assert.deepStrictEqual(
getTransactionsForUI([
Expand All @@ -84,6 +85,7 @@ describe('Wallet', function () {
]
)
})

it('lists only succeeded transactions', function () {
assert.deepStrictEqual(
getTransactionsForUI([
Expand Down

0 comments on commit 5500d08

Please sign in to comment.