Add controller tests (#4205)

* add walletHome test template

* add create test

* add fixtures

* do not mock parseSecret

* better hash

* use fixtures for create controller test

* add import test

* stubs reset

* add more controller tests

* Remove $state dependency

* refactore fixtures + profiles

* add backup.js test

* update bwc

* rm log
This commit is contained in:
Matias Alejo Garcia 2016-05-20 11:50:55 -03:00
commit aec2aac47b
20 changed files with 2265 additions and 28 deletions

View file

@ -38,6 +38,10 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
}
};
root.is = function(name) {
return $state.is(name);
};
root.path = function(path, cb) {
$state.transitionTo(path)
.then(function() {

View file

@ -148,9 +148,8 @@ angular.module('copayApp.services')
root.isDisclaimerAccepted(function(val) {
if (!val) {
return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
} else {
return cb();
}
}
return cb();
});
});
});
@ -306,7 +305,8 @@ angular.module('copayApp.services')
if (err) return cb(err);
walletClient.createWallet(opts.name, opts.myName || 'me', opts.m, opts.n, {
network: opts.networkName
network: opts.networkName,
walletPrivKey: opts.walletPrivKey,
}, function(err, secret) {
if (err) return bwsError.cb(err, gettext('Error creating wallet'), cb);
@ -571,6 +571,7 @@ angular.module('copayApp.services')
if (err) return cb(err);
root.bindProfile(p, function(err) {
// ignore NONAGREEDDISCLAIMER
storageService.storeNewProfile(p, function(err) {
return cb(err);
});
@ -588,7 +589,6 @@ angular.module('copayApp.services')
root.isDisclaimerAccepted = function(cb) {
var disclaimerAccepted = root.profile && root.profile.disclaimerAccepted;
if (disclaimerAccepted)
return cb(true);