Skip to content

Commit

Permalink
fix(): rewards test
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Jiang committed Dec 10, 2018
1 parent 293f40d commit 10eef29
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/rewards.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ test.before(async (t) => {
t.context.farmerAccount2 = await mirrorIdentity(TEST_FARMER_DID2)
t.context.farmerAccount3 = await mirrorIdentity(TEST_FARMER_DID3)

await sendEthAraAndDeposit(TEST_FARMER_DID1)
await sendEthAraAndDeposit(TEST_FARMER_DID2)
await sendEthAraAndDeposit(TEST_FARMER_DID3)
})

test.after(async (t) => {
Expand Down Expand Up @@ -273,6 +272,8 @@ test.serial('redeem(opts) insufficient deposit', async (t) => {
val: '100',
withdraw: true
})
const amountDeposited = await token.getAmountDeposited(TEST_FARMER_DID2)
t.is(amountDeposited, '0')

await t.throwsAsync(rewards.redeem({ farmerDid: TEST_FARMER_DID2, contentDid, password }), Error)
})
Expand All @@ -285,6 +286,8 @@ test.serial('redeem(opts)', async (t) => {
password,
val: '100'
})
const amountDeposited = await token.getAmountDeposited(TEST_FARMER_DID2)
t.is(amountDeposited, '100')

const cost = await rewards.redeem({
farmerDid: TEST_FARMER_DID1,
Expand Down

0 comments on commit 10eef29

Please sign in to comment.