diff --git a/test/test.WalletFactory.js b/test/test.WalletFactory.js index f9098d8be..c9f8bde5c 100644 --- a/test/test.WalletFactory.js +++ b/test/test.WalletFactory.js @@ -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 + }); + }); + });