From 2b62f349eec390f56a195088177d7597e428bb70 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Mon, 14 Nov 2016 18:18:38 -0300 Subject: [PATCH] Fill totalSupply in StandardTokenMock --- contracts/test-helpers/StandardTokenMock.sol | 1 + test/StandardToken.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/contracts/test-helpers/StandardTokenMock.sol b/contracts/test-helpers/StandardTokenMock.sol index 794d78090..55a9fc38e 100644 --- a/contracts/test-helpers/StandardTokenMock.sol +++ b/contracts/test-helpers/StandardTokenMock.sol @@ -6,6 +6,7 @@ contract StandardTokenMock is StandardToken { function StandardTokenMock(address initialAccount, uint initialBalance) { balances[initialAccount] = initialBalance; + totalSupply = initialBalance; } } diff --git a/test/StandardToken.js b/test/StandardToken.js index 6b83b32b8..ec2f158cd 100644 --- a/test/StandardToken.js +++ b/test/StandardToken.js @@ -1,5 +1,16 @@ contract('StandardToken', function(accounts) { + it("should return the correct totalSupply after construction", function(done) { + return StandardTokenMock.new(accounts[0], 100) + .then(function(token) { + return token.totalSupply(); + }) + .then(function(totalSupply) { + assert.equal(totalSupply, 100); + }) + .then(done); + }) + it("should return the correct allowance amount after approval", function(done) { var token; return StandardTokenMock.new()