mirror of https://github.com/BTCPrivate/copay.git
add tests for WalletFactory
This commit is contained in:
parent
7ae6438478
commit
952b2a6d36
|
@ -169,4 +169,21 @@ describe('WalletFactory model', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('#joinCreateSession', function() {
|
||||
it('should call network.start', function() {
|
||||
var wf = new WalletFactory(config, '0.0.1');
|
||||
wf.network.cleanUp = sinon.spy();
|
||||
wf.network.start = sinon.spy();
|
||||
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test', null, undefined);
|
||||
wf.network.start.calledOnce.should.equal(true);
|
||||
});
|
||||
it('should call network.start with private key', function() {
|
||||
var wf = new WalletFactory(config, '0.0.1');
|
||||
wf.network.cleanUp = sinon.spy();
|
||||
wf.network.start = sinon.spy();
|
||||
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test', null, undefined);
|
||||
wf.network.start.getCall(0).args[0].privkey.length.should.equal(64); //privkey is hex of private key buffer
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue