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() {
|
||||
var w = $rootScope.wallet;
|
||||
w.disconnect();
|
||||
walletFactory.delete(w.id, function() {
|
||||
controllerUtils.logout();
|
||||
});
|
||||
};
|
||||
|
||||
// Cached list of copayers
|
||||
$scope.copayers = $rootScope.wallet.getRegisteredPeerIds();
|
||||
|
||||
$scope.copayersList = function() {
|
||||
return $rootScope.wallet.getRegisteredPeerIds();
|
||||
$scope.copayers = $rootScope.wallet.getRegisteredPeerIds();
|
||||
return $scope.copayers;
|
||||
}
|
||||
|
||||
$scope.isBackupReady = function(copayer) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ describe("Unit: Controllers", function() {
|
|||
});
|
||||
|
||||
|
||||
describe('Backup Controller', function() {
|
||||
describe('More Controller', function() {
|
||||
var ctrl;
|
||||
beforeEach(inject(function($controller, $rootScope) {
|
||||
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() {
|
||||
var what;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
</small>
|
||||
</h3>
|
||||
|
||||
<div class="copay-box-small" ng-repeat="copayer in copayers">
|
||||
<div class="copay-box-small" ng-repeat="copayer in copayersList()">
|
||||
<img
|
||||
class="br100 online"
|
||||
src="./img/satoshi.gif"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue