Commit 4d3f870b authored by Moody Salem's avatar Moody Salem

add a test for calculating slippage amounts

parent 452f2dc3
...@@ -34,6 +34,10 @@ describe('utils', () => { ...@@ -34,6 +34,10 @@ describe('utils', () => {
'100', '100',
'100', '100',
]) ])
expect(calculateSlippageAmount(tokenAmount, new Percent(5, 100)).map((bound) => bound.toString())).toEqual([
'95',
'105',
])
expect(calculateSlippageAmount(tokenAmount, new Percent(100, 10_000)).map((bound) => bound.toString())).toEqual([ expect(calculateSlippageAmount(tokenAmount, new Percent(100, 10_000)).map((bound) => bound.toString())).toEqual([
'99', '99',
'101', '101',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment