Skip to content

Commit

Permalink
add test for unstaking with zero
Browse files Browse the repository at this point in the history
  • Loading branch information
dmosites committed Jan 25, 2024
1 parent ba862d3 commit 927e820
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/staking/test/Staking.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@ describe('Staking Unit', () => {
expect(userStake.balance).to.equal(0)
})

it('fails attempting to unstake zero', async () => {
await token.mock.transferFrom.returns(true)
await token.mock.transfer.returns(true)
await staking.connect(account1).stake('100')
await expect(staking.connect(account1).unstake('0'))
.to.be.revertedWith('AmountInvalid')
.withArgs(0)
})

it('successful partial unstaking', async () => {
await token.mock.transferFrom.returns(true)
await token.mock.transfer.returns(true)
Expand Down

0 comments on commit 927e820

Please sign in to comment.