Skip to content

Commit

Permalink
Add missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nventuro committed Jun 11, 2020
1 parent e303cce commit f10c9af
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/utils/Address.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,13 @@ describe('Address', function () {
inputs: [],
}, []);

const tracker = await balance.tracker(this.contractRecipient.address);

await send.ether(other, this.mock.address, amount);
const receipt = await this.mock.functionCallWithValue(this.contractRecipient.address, abiEncodedCall, amount);

expect(await tracker.delta()).to.be.bignumber.equal(amount);

expectEvent(receipt, 'CallReturnValue', { data: '0x1234' });
await expectEvent.inTransaction(receipt.tx, CallReceiverMock, 'MockFunctionCalled');
});
Expand All @@ -247,11 +251,15 @@ describe('Address', function () {
inputs: [],
}, []);

const tracker = await balance.tracker(this.contractRecipient.address);

expect(await balance.current(this.mock.address)).to.be.bignumber.equal('0');
const receipt = await this.mock.functionCallWithValue(
this.contractRecipient.address, abiEncodedCall, amount, { from: other, value: amount }
);

expect(await tracker.delta()).to.be.bignumber.equal(amount);

expectEvent(receipt, 'CallReturnValue', { data: '0x1234' });
await expectEvent.inTransaction(receipt.tx, CallReceiverMock, 'MockFunctionCalled');
});
Expand Down

0 comments on commit f10c9af

Please sign in to comment.