Skip to content

Commit

Permalink
updated test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tech-somish committed Nov 2, 2018
1 parent ab88ede commit e61a1bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/05_GBM.js
Expand Up @@ -148,6 +148,9 @@ contract('GovBlocksMaster', function([owner, notOwner]) {
this.timeout(100000);
// TODO check all the data returned by getters
let g1 = await gbm.getGovBlocksDappDetails('0x41');
await catchRevert(
gbm.getGovBlocksDappDetails('0x51')
);
let g2 = await gbm.getGovBlocksDappDetailsByIndex(0);
let g4 = await gbm.getDappDetailsByAddress(gbm.address);
let dAppLength = await gbm.getAllDappLength();
Expand Down
10 changes: 8 additions & 2 deletions test/07_Governance.js
Expand Up @@ -310,10 +310,10 @@ contract('Governance', ([owner, notOwner, noStake]) => {
pr[0].should.be.bignumber.eq(e18.div(2.5));
pr = await pl.getPendingReward(notOwner, 0);
pr[0].should.be.bignumber.eq(e18.mul(6).div(10));
[ownerProposals, voterProposals] = await getProposalIds(owner, gd, sv);
await pl.claimReward(owner, ownerProposals, voterProposals);
[ownerProposals, voterProposals] = await getProposalIds(notOwner, gd, sv);
await pl.claimReward(notOwner, ownerProposals, voterProposals);
[ownerProposals, voterProposals] = await getProposalIds(owner, gd, sv);
await pl.claimReward(owner, ownerProposals, voterProposals);
const b2 = await gbt.balanceOf(owner);
const g2 = await gv.getMemberDetails(notOwner);
b2.should.be.bignumber.above(b1);
Expand All @@ -323,6 +323,12 @@ contract('Governance', ([owner, notOwner, noStake]) => {
pr2[1].should.be.bignumber.eq(0);
});

it('Should not claim rewards for proposals, in case rewards are already claimed ', async () =>{
await catchRevert(
pl.claimReward(owner, ownerProposals, voterProposals)
);
});

it('Should close proposal', async () => {
await sv.closeProposalVote(propId);
await catchRevert(sv.closeProposalVote(propId));
Expand Down

0 comments on commit e61a1bb

Please sign in to comment.