test balance returns only addresses with funds
This commit is contained in:
parent
6838f8d204
commit
cdb2df0cb8
|
@ -645,7 +645,7 @@ describe('Copay server', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.only('#getBalance', function() {
|
describe('#getBalance', function() {
|
||||||
var server, wallet;
|
var server, wallet;
|
||||||
beforeEach(function(done) {
|
beforeEach(function(done) {
|
||||||
helpers.createAndJoinWallet(1, 1, function(s, w) {
|
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() {
|
describe('Wallet not complete tests', function() {
|
||||||
|
|
Loading…
Reference in New Issue