fix tests

This commit is contained in:
Matias Alejo Garcia 2016-06-13 17:10:03 -03:00
parent f15096b428
commit a1eca63de4
No known key found for this signature in database
GPG Key ID: 02470DB551277AB3
4 changed files with 21 additions and 1 deletions

View File

@ -44,6 +44,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
root.set = function(processName, isOn) {
console.log('[onGoingProcess.js.46]', processName); //TODO
$log.debug('ongoingProcess', processName, isOn);
root[processName] = isOn;
ongoingProcess[processName] = isOn;
@ -58,13 +59,21 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
root.onGoingProcessName = name;
var showName = processNames[name] || gettextCatalog.getString(name);
console.log('[onGoingProcess.js.62]'); //TODO
if (root.onGoingProcessName) {
console.log('[onGoingProcess.js.65]'); //TODO
if (isCordova) {
window.plugins.spinnerDialog.show(null, showName, true);
} else {
console.log('[onGoingProcess.js.70]'); //TODO
$ionicLoading.show({
template: showName,
});
console.log('[onGoingProcess.js.75]'); //TODO
}
} else {
if (isCordova) {

View File

@ -117,6 +117,7 @@ describe('createController', function() {
it('should create a 1-1 wallet from mnemonic', function(done) {
var fakeForm = {};
console.log('[create.test.js.119]'); //TODO
// FROM DATA
scope.seedSource = {
id: 'set'
@ -131,8 +132,12 @@ describe('createController', function() {
scope._walletPrivKey = 'Kz4CFSTgLzoYfMkt97BTBotUbZYXjMts6Ej9HbVfCf5oLmun1BXy';
ctrl.setSeedSource();
console.log('[create.test.js.135]'); //TODO
ctrl.create(fakeForm);
console.log('[create.test.js.138]'); //TODO
should.not.exist(ctrl.error);
mocks.go.walletHome.calledOnce.should.equal(true);
//

View File

@ -74,7 +74,8 @@ describe('disclaimerController', function() {
mnemonic: 'tunnel fork scare industry noble snow tank bullet over gesture nuclear next',
});
setTimeout(function() {
ctrl.creatingProfile.should.equal(false);
mocks.ongoingProcess.set.getCall(1).args[0].should.equal('creatingWallet');
mocks.ongoingProcess.set.getCall(1).args[1].should.equal(false);
done();
}, 100);
});

View File

@ -42,6 +42,10 @@ mocks.$timeout = function(cb) {
};
mocks.modal = function() {};
mocks.ongoingProcess = {
set: sinon.stub(),
clear: sinon.stub(),
};
mocks.setProfile = function(profile) {};
@ -192,6 +196,7 @@ mocks.init = function(fixtures, controllerName, opts, done) {
ctrl = $controller(controllerName, {
$scope: scope,
$modal: mocks.modal,
ongoingProcess: mocks.ongoingProcess,
notification: mocks.notification,
configService: _configService_,
profileService: _profileService_,