implements delete wallet, in backuptab

This commit is contained in:
Matias Alejo Garcia 2014-06-16 17:37:33 -03:00
commit 2c60fd91c0
7 changed files with 219 additions and 79 deletions

View file

@ -75,7 +75,7 @@ describe('WalletFactory model', function() {
should.exist(w.publicKeyRing.getCopayerId);
should.exist(w.txProposals.toObj);
should.exist(w.privateKey.toObj);
JSON.stringify(w.toObj()).should.equal(o);
});
@ -98,7 +98,7 @@ describe('WalletFactory model', function() {
"wallet": {
"requiredCopayers": 2,
"totalCopayers": 3,
"reconnectDelay":100,
"reconnectDelay": 100,
"spendUnconfirmed": 1,
"verbose": 0
},
@ -122,4 +122,28 @@ describe('WalletFactory model', function() {
});
it('should be able to get current wallets', function() {
var wf = new WalletFactory(config, '0.0.1');
var w = wf.create({
name: 'test wallet'
});
var ws = wf.getWallets();
ws.length.should.equal(1);
ws[0].name.should.equal('test wallet');
});
it('should be able to delete wallet', function(done) {
var wf = new WalletFactory(config, '0.0.1');
var w = wf.create({
name: 'test wallet'
});
var ws = wf.getWallets();
ws.length.should.equal(1);
wf.delete(ws[0].id, function() {
ws = wf.getWallets();
ws.length.should.equal(0);
done();
});
});
});