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()