Feature/use expect event in test logs assertions #1232 (#1343)

* Add BigNumber support to expectEvent/inLogs (#1026)

* switched direct logs array check to expectEvent method in AllowanceCrowdsale.test.js

* Refactor expectEvent.inLogs function to use simple value number check

* Introduced should.be.bignumber method to compare BigNumber values

* Use expectEvent to test logs (#1232)

* Removed trailing space

(cherry picked from commit 536262f2ec)
This commit is contained in:
Jakub Bogacz
2018-09-27 16:33:28 +02:00
committed by Leo Arias
parent a9af619c59
commit 39db4b4b05
12 changed files with 135 additions and 134 deletions

View File

@ -54,9 +54,8 @@ contract('RefundEscrow', function ([_, primary, beneficiary, refundee1, refundee
it('only the primary account can enter closed state', async function () {
await expectThrow(this.escrow.close({ from: beneficiary }), EVMRevert);
const receipt = await this.escrow.close({ from: primary });
expectEvent.inLogs(receipt.logs, 'Closed');
const { logs } = await this.escrow.close({ from: primary });
expectEvent.inLogs(logs, 'Closed');
});
context('closed state', function () {
@ -94,9 +93,8 @@ contract('RefundEscrow', function ([_, primary, beneficiary, refundee1, refundee
it('only the primary account can enter refund state', async function () {
await expectThrow(this.escrow.enableRefunds({ from: beneficiary }), EVMRevert);
const receipt = await this.escrow.enableRefunds({ from: primary });
expectEvent.inLogs(receipt.logs, 'RefundsEnabled');
const { logs } = await this.escrow.enableRefunds({ from: primary });
expectEvent.inLogs(logs, 'RefundsEnabled');
});
context('refund state', function () {