add test for priv key import

This commit is contained in:
Matias Alejo Garcia 2014-08-20 20:16:20 -04:00
parent 2fbbd2a53a
commit ca23aed70f
1 changed files with 9 additions and 1 deletions

View File

@ -404,9 +404,17 @@ describe('WalletFactory model', 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.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test');
wf.network.start.calledOnce.should.equal(true);
});
it('should accept a priv key a input', function() {
var wf = new WalletFactory(config, '0.0.1');
var privHex = 'tprv8ZgxMBicQKsPf7MCvCjnhnr4uiR2Z2gyNC27vgd9KUu98F9mM1tbaRrWMyddVju36GxLbeyntuSadBAttriwGGMWUkRgVmUUCg5nFioGZsd';
wf.network.cleanUp = sinon.spy();
wf.network.start = sinon.spy();
wf.joinCreateSession('8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM', 'test', null, privHex);
wf.network.start.getCall(0).args[0].privkey.should.equal('ddc2fa8c583a73c4b2a24630ec7c283df4e7c230a02c4e48bc36ec61687afd7d');
});
it('should call network.start with private key', function() {
var wf = new WalletFactory(config, '0.0.1');
wf.network.cleanUp = sinon.spy();