Tests improvements

This commit is contained in:
Matias Pando 2014-12-18 13:02:02 -03:00
commit f245ba8022
2 changed files with 16 additions and 20 deletions

View file

@ -203,6 +203,7 @@ describe('Wallet model', function() {
sinon.spy(w, 'sendIndexes');
sinon.spy(w, 'sendTxProposal');
w.spend({
toAddress: toAddress,
amountSat: amountSatStr,
@ -213,6 +214,9 @@ describe('Wallet model', function() {
w.sendTxProposal.calledOnce.should.equal(true);
w.sendIndexes.calledOnce.should.equal(false);
w.network.send.calledOnce.should.equal(true);
var p = w.getPendingTxProposalsCount();
p.pending.should.be.equal(1);
p.pendingForUs.should.be.equal(0);
@ -766,13 +770,16 @@ describe('Wallet model', function() {
it('should close wallet', function(done) {
var w = createW2();
w.removeAllListeners = sinon.stub();
w.network.removeAllListeners = sinon.stub();
w.network.cleanUp = sinon.stub();
w.blockchain.removeAllListeners = sinon.stub();
w.blockchain.destroy = sinon.stub();
w.close(function() {
w.network.removeAllListeners.calledOnce.should.equal(true);
w.network.cleanUp.calledOnce.should.equal(true);
w.blockchain.removeAllListeners.calledOnce.should.equal(true);
w.network.cleanUp.calledOnce.should.equal(true);
done();
});
});