fix unit tests

This commit is contained in:
Moody Salem 2021-05-03 20:39:03 -05:00
parent 4903258b7c
commit 7ca79ff12b
No known key found for this signature in database
GPG Key ID: 8CB5CD10385138DB

@ -10,19 +10,16 @@ describe('prices', () => {
const pair12 = new Pair(new TokenAmount(token1, JSBI.BigInt(10000)), new TokenAmount(token2, JSBI.BigInt(20000)))
const pair23 = new Pair(new TokenAmount(token2, JSBI.BigInt(20000)), new TokenAmount(token3, JSBI.BigInt(30000)))
describe('#computeTradePriceBreakdown', () => {
describe('#computeRealizedLPFeeAmount', () => {
it('returns undefined for undefined', () => {
expect(computeRealizedLPFeeAmount(undefined)).toEqual({
priceImpactWithoutFee: undefined,
realizedLPFee: undefined,
})
expect(computeRealizedLPFeeAmount(undefined)).toEqual(undefined)
})
it('correct realized lp fee for single hop', () => {
expect(
computeRealizedLPFeeAmount(
new Trade(new Route([pair12], token1), new TokenAmount(token1, JSBI.BigInt(1000)), TradeType.EXACT_INPUT)
).realizedLPFee
)
).toEqual(new TokenAmount(token1, JSBI.BigInt(3)))
})
@ -34,7 +31,7 @@ describe('prices', () => {
new TokenAmount(token1, JSBI.BigInt(1000)),
TradeType.EXACT_INPUT
)
).realizedLPFee
)
).toEqual(new TokenAmount(token1, JSBI.BigInt(5)))
})
})