add tests for Wallet

This commit is contained in:
Ryan X. Charles 2014-06-19 11:03:31 -07:00
commit 7ae6438478
2 changed files with 48 additions and 3 deletions

View file

@ -755,4 +755,49 @@ describe('Wallet model', function() {
Object.keys(w.addressBook).length.should.equal(3);
});
it('#getNetworkName', function() {
var w = createW();
w.getNetworkName().should.equal('testnet');
});
describe('#getMyCopayerId', function() {
it('should call getCopayerId', function() {
//this.timeout(10000);
var w = createW2();
w.getCopayerId = sinon.spy();
w.getMyCopayerId();
w.getCopayerId.calledOnce.should.equal(true);
});
});
describe('#getMyCopayerIdPriv', function() {
it('should call privateKey.getIdPriv', function() {
//this.timeout(10000);
var w = createW2();
w.privateKey.getIdPriv = sinon.spy();
w.getMyCopayerIdPriv();
w.privateKey.getIdPriv.calledOnce.should.equal(true);
});
});
describe('#netStart', function() {
it('should call Network.start', function() {
//this.timeout(10000);
var w = createW2();
w.network.start = sinon.spy();
w.netStart();
w.network.start.calledOnce.should.equal(true);
});
it('should call Network.start with a private key', function() {
//this.timeout(10000);
var w = createW2();
w.network.start = sinon.spy();
w.netStart();
w.network.start.getCall(0).args[0].privkey.length.should.equal(64);
});
});
});