fixed tests

This commit is contained in:
Ivan Socolsky 2014-10-28 15:56:03 -03:00
commit 0190a9d1fe
2 changed files with 13 additions and 20 deletions

View file

@ -240,7 +240,7 @@ describe('Identity model', function() {
});
describe('#importWallet', function() {
it('should import a wallet, call the right encryption functions',function(done) {
it('should import a wallet, call the right encryption functions', function(done) {
var args = createIdentity();
args.storage.getItem.onFirstCall().callsArgWith(1, null, '{"wallet": "fakeData"}');
var backup = Wallet.fromUntrustedObj;
@ -257,14 +257,13 @@ describe('Identity model', function() {
cryptoUtil: fakeCrypto,
};
Identity.create(args.params, function(err, iden) {
iden.importEncryptedWallet(123,'password', opts, function(err){
should.not.exist(err);
fakeCrypto.kdf.getCall(0).args[0].should.equal('password');
fakeCrypto.decrypt.getCall(0).args[0].should.equal('passphrase');
fakeCrypto.decrypt.getCall(0).args[1].should.equal(123);
done();
});
var iden = Identity.create(args.params);
iden.importEncryptedWallet(123, 'password', opts, function(err) {
should.not.exist(err);
fakeCrypto.kdf.getCall(0).args[0].should.equal('password');
fakeCrypto.decrypt.getCall(0).args[0].should.equal('passphrase');
fakeCrypto.decrypt.getCall(0).args[1].should.equal(123);
done();
});
});
});

File diff suppressed because one or more lines are too long