Skip to content

Commit

Permalink
[added test for estimation based on orderbook][references issue #3]
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed May 1, 2020
1 parent 521c506 commit e5fb0cf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lisk-dex-electron/src/__tests__/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import {
groupByKey, Keys, Values, formatThousands,
} from '../Utils';

import * as orderbook from './fixtures/orderbook1';

describe('Utils tests => ', () => {
test.each`
largeNumber | expectedFormattedLargeNumber
Expand Down Expand Up @@ -57,4 +59,13 @@ describe('Utils tests => ', () => {
const expectedValues = [{ price: 0.8, value: 7 }, { price: 0.85, value: 1 }, { price: 0.86, value: 1 }, { price: 0.9, value: 1 }, { price: 0.92, value: 6 }];
expect(Values(actualDict)).toEqual(expectedValues);
});

test.each`
testOrderBook | amountInLsk | rate
${orderbook} | ${'2000'} | ${0.32}
`('Should estimate $amountInLsk based on $rate', ({ testOrderBook, amountInLsk, rate }) => {
console.log(`orderbook is ${testOrderBook}`);
console.log(`amount in lsk is ${amountInLsk}`);
console.log(`rate is ${rate}`);
});
});

0 comments on commit e5fb0cf

Please sign in to comment.