updates karma tests

This commit is contained in:
Matias Alejo Garcia 2014-11-30 23:08:16 -03:00
commit f490f4a661
6 changed files with 37 additions and 46 deletions

View file

@ -147,7 +147,8 @@ angular.module('copayApp.controllers').controller('HistoryController',
_.each(res, function(r) {
var tx = index[r.ts];
tx.alternativeAmount = $filter('noFractionNumber')(
(r.rate != null ? tx.amountSat * rateService.SAT_TO_BTC * r.rate : null);
(r.rate != null ? tx.amountSat * rateService.SAT_TO_BTC * r.rate : null))
;
});
setTimeout(function() {
$scope.$digest();

View file

@ -1,5 +1,5 @@
'use strict';
angular.module('copayApp.controllers').controller('ProfileController', function($scope, $rootScope, $location, $modal, backupService) {
angular.module('copayApp.controllers').controller('ProfileController', function($scope, $rootScope, $location, $modal, backupService, identityService) {
$scope.username = $rootScope.iden.getName();
$scope.isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
@ -16,10 +16,11 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
$scope.deleteWallet = function(w) {
if (!w) return;
$scope.loading = w.id;
identityService.deleteWallet(w.id,function() {
identityService.deleteWallet(w, function(err) {
$scope.loading = false;
if (err) {
log.warn(err);
}
});
};

View file

@ -19,6 +19,7 @@ angular.module('copayApp.services')
var r = {};
r.totalBalance = $filter('noFractionNumber')(balanceSat * satToUnit);
r.totalBalanceBTC = (balanceSat / COIN);
var availableBalanceNr = safeBalanceSat * satToUnit;
r.availableBalance = $filter('noFractionNumber')(safeBalanceSat * satToUnit);
r.availableBalanceBTC = (safeBalanceSat / COIN);
r.safeUnspentCount = safeUnspentCount;
@ -29,7 +30,7 @@ angular.module('copayApp.services')
if (r.safeUnspentCount) {
var estimatedFee = copay.Wallet.estimatedFee(r.safeUnspentCount);
r.topAmount = (((r.availableBalance * w.settings.unitToSatoshi).toFixed(0) - estimatedFee) / w.settings.unitToSatoshi);
r.topAmount = (((availableBalanceNr * w.settings.unitToSatoshi).toFixed(0) - estimatedFee) / w.settings.unitToSatoshi);
}
var balanceByAddr = {};

View file

@ -87,8 +87,8 @@ angular.module('copayApp.services')
});
};
root.deleteWallet = function($scope, iden, w) {
$rootScope.iden.deleteWallet(w.id);
root.deleteWallet = function(w, cb) {
$rootScope.iden.deleteWallet(w.id, cb);
};
root.isFocused = function(wid) {