Merge pull request #1327 from cmgustavo/bug/01-delete-wallet
Bug/01 delete wallet
This commit is contained in:
commit
3d991822d2
3 changed files with 27 additions and 7 deletions
|
|
@ -21,17 +21,14 @@ angular.module('copayApp.controllers').controller('CopayersController',
|
||||||
|
|
||||||
$scope.deleteWallet = function() {
|
$scope.deleteWallet = function() {
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
w.disconnect();
|
|
||||||
walletFactory.delete(w.id, function() {
|
walletFactory.delete(w.id, function() {
|
||||||
controllerUtils.logout();
|
controllerUtils.logout();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Cached list of copayers
|
|
||||||
$scope.copayers = $rootScope.wallet.getRegisteredPeerIds();
|
|
||||||
|
|
||||||
$scope.copayersList = function() {
|
$scope.copayersList = function() {
|
||||||
return $rootScope.wallet.getRegisteredPeerIds();
|
$scope.copayers = $rootScope.wallet.getRegisteredPeerIds();
|
||||||
|
return $scope.copayers;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.isBackupReady = function(copayer) {
|
$scope.isBackupReady = function(copayer) {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ describe("Unit: Controllers", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe('Backup Controller', function() {
|
describe('More Controller', function() {
|
||||||
var ctrl;
|
var ctrl;
|
||||||
beforeEach(inject(function($controller, $rootScope) {
|
beforeEach(inject(function($controller, $rootScope) {
|
||||||
scope = $rootScope.$new();
|
scope = $rootScope.$new();
|
||||||
|
|
@ -479,7 +479,30 @@ describe("Unit: Controllers", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Copayers Controller', function() {
|
||||||
|
var saveDownload = null;
|
||||||
|
var ctrl;
|
||||||
|
beforeEach(inject(function($controller, $rootScope) {
|
||||||
|
scope = $rootScope.$new();
|
||||||
|
|
||||||
|
$rootScope.wallet = new FakeWallet(walletConfig);
|
||||||
|
ctrl = $controller('CopayersController', {
|
||||||
|
$scope: scope,
|
||||||
|
$modal: {},
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should exist', function() {
|
||||||
|
should.exist(ctrl);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Delete Wallet', function() {
|
||||||
|
expect(scope.wallet).not.equal(undefined);
|
||||||
|
scope.deleteWallet();
|
||||||
|
expect(scope.wallet).equal(undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
describe('Join Controller', function() {
|
describe('Join Controller', function() {
|
||||||
var what;
|
var what;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
</small>
|
</small>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="copay-box-small" ng-repeat="copayer in copayers">
|
<div class="copay-box-small" ng-repeat="copayer in copayersList()">
|
||||||
<img
|
<img
|
||||||
class="br100 online"
|
class="br100 online"
|
||||||
src="./img/satoshi.gif"
|
src="./img/satoshi.gif"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue