From cdb2df0cb83c7a447229a66849e4027d71b30035 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Fri, 6 Mar 2015 15:02:54 -0300 Subject: [PATCH] test balance returns only addresses with funds --- test/integration/server.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/integration/server.js b/test/integration/server.js index 6792b80..011df7b 100644 --- a/test/integration/server.js +++ b/test/integration/server.js @@ -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() {