Explorar el Código

Added Events tests of Pausable contract (#1207)

viquezclaudio hace 7 años
padre
commit
132994d286
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      test/lifecycle/Pausable.test.js

+ 9 - 0
test/lifecycle/Pausable.test.js

@@ -1,4 +1,5 @@
 const { assertRevert } = require('../helpers/assertRevert');
+const expectEvent = require('../helpers/expectEvent');
 const PausableMock = artifacts.require('PausableMock');
 
 const BigNumber = web3.BigNumber;
@@ -53,4 +54,12 @@ contract('Pausable', function () {
 
     (await this.Pausable.drasticMeasureTaken()).should.equal(false);
   });
+
+  it('should log Pause and Unpause events appropriately', async function () {
+    const setPauseLogs = (await this.Pausable.pause()).logs;
+    expectEvent.inLogs(setPauseLogs, 'Pause');
+
+    const setUnPauseLogs = (await this.Pausable.unpause()).logs;
+    expectEvent.inLogs(setUnPauseLogs, 'Unpause');
+  });
 });