diff --git a/ethereum/test/Proposals.js b/ethereum/test/Proposals.js index 333c44f..0daf64c 100644 --- a/ethereum/test/Proposals.js +++ b/ethereum/test/Proposals.js @@ -44,20 +44,20 @@ describe('Proposal', () => { let dao; let proposals; let account1; - // let account2; + let account2; let proposal; + let postIndex; beforeEach(async () => { ({ dao, proposals, account1, - // account2, + account2, } = await loadFixture(deploy)); - console.log('postCount', await dao.postCount()); await dao.addPost(account1, 'proposal-content-id'); - const postIndex = await dao.postCount() - BigInt(1); + postIndex = await dao.postCount() - BigInt(1); const post = await dao.posts(postIndex); expect(await post.contentId).to.equal('proposal-content-id'); await proposals.propose(postIndex, 20, 20, 20, { value: 100 }); @@ -79,8 +79,17 @@ describe('Proposal', () => { describe('Evaluate attestation', () => { it('when threshold is met, advance to referendum 0% binding', async () => { + console.log('total REP', await dao.totalSupply()); await proposals.attest(0, 20); - await proposals.evaluateAttestation(0); + await expect(proposals.evaluateAttestation(0)).to.emit(dao, 'ValidationPoolInitiated').withArgs(postIndex); + proposal = await proposals.proposals(0); + expect(proposal.stage).to.equal(1); + }); + + it('threshold may be met by accumulation of attestations', async () => { + await proposals.connect(account1).attest(0, 10); + await proposals.connect(account2).attest(0, 20); + await expect(proposals.evaluateAttestation(0)).to.emit(dao, 'ValidationPoolInitiated').withArgs(postIndex); proposal = await proposals.proposals(0); expect(proposal.stage).to.equal(1); }); @@ -97,5 +106,16 @@ describe('Proposal', () => { expect(proposal.stage).to.equal(4); // Stage.Closed }); }); + + describe('Referendum 0% binding', () => { + beforeEach(async () => { + await proposals.attest(0, 20); + await expect(proposals.evaluateAttestation(0)).to.emit(dao, 'ValidationPoolInitiated').withArgs(postIndex); + }); + + it('', async () => { + + }); + }); }); });