test balance returns only addresses with funds

This commit is contained in:
Ivan Socolsky 2015-03-06 15:02:54 -03:00
parent 6838f8d204
commit cdb2df0cb8
1 changed files with 15 additions and 1 deletions

View File

@ -645,7 +645,7 @@ describe('Copay server', function() {
});
});
describe.only('#getBalance', function() {
describe('#getBalance', function() {
var server, wallet;
beforeEach(function(done) {
helpers.createAndJoinWallet(1, 1, function(s, w) {
@ -701,6 +701,20 @@ describe('Copay server', function() {
});
});
});
it('should only include addresses with balance', function(done) {
helpers.stubUtxos(server, wallet, 1, function(utxos) {
server.createAddress({}, function(err, address) {
should.not.exist(err);
server.getBalance({}, function(err, balance) {
should.not.exist(err);
balance.byAddress.length.should.equal(1);
balance.byAddress[0].amount.should.equal(helpers.toSatoshi(1));
balance.byAddress[0].address.should.equal(utxos[0].address);
done();
});
});
});
});
});
describe('Wallet not complete tests', function() {