fix tests
This commit is contained in:
parent
f15096b428
commit
a1eca63de4
4 changed files with 21 additions and 1 deletions
|
|
@ -44,6 +44,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
|
||||||
|
|
||||||
root.set = function(processName, isOn) {
|
root.set = function(processName, isOn) {
|
||||||
|
|
||||||
|
console.log('[onGoingProcess.js.46]', processName); //TODO
|
||||||
$log.debug('ongoingProcess', processName, isOn);
|
$log.debug('ongoingProcess', processName, isOn);
|
||||||
root[processName] = isOn;
|
root[processName] = isOn;
|
||||||
ongoingProcess[processName] = isOn;
|
ongoingProcess[processName] = isOn;
|
||||||
|
|
@ -58,13 +59,21 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
|
||||||
root.onGoingProcessName = name;
|
root.onGoingProcessName = name;
|
||||||
|
|
||||||
var showName = processNames[name] || gettextCatalog.getString(name);
|
var showName = processNames[name] || gettextCatalog.getString(name);
|
||||||
|
|
||||||
|
console.log('[onGoingProcess.js.62]'); //TODO
|
||||||
if (root.onGoingProcessName) {
|
if (root.onGoingProcessName) {
|
||||||
|
|
||||||
|
console.log('[onGoingProcess.js.65]'); //TODO
|
||||||
if (isCordova) {
|
if (isCordova) {
|
||||||
window.plugins.spinnerDialog.show(null, showName, true);
|
window.plugins.spinnerDialog.show(null, showName, true);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
console.log('[onGoingProcess.js.70]'); //TODO
|
||||||
$ionicLoading.show({
|
$ionicLoading.show({
|
||||||
template: showName,
|
template: showName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('[onGoingProcess.js.75]'); //TODO
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isCordova) {
|
if (isCordova) {
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@ describe('createController', function() {
|
||||||
it('should create a 1-1 wallet from mnemonic', function(done) {
|
it('should create a 1-1 wallet from mnemonic', function(done) {
|
||||||
var fakeForm = {};
|
var fakeForm = {};
|
||||||
|
|
||||||
|
console.log('[create.test.js.119]'); //TODO
|
||||||
// FROM DATA
|
// FROM DATA
|
||||||
scope.seedSource = {
|
scope.seedSource = {
|
||||||
id: 'set'
|
id: 'set'
|
||||||
|
|
@ -131,8 +132,12 @@ describe('createController', function() {
|
||||||
scope._walletPrivKey = 'Kz4CFSTgLzoYfMkt97BTBotUbZYXjMts6Ej9HbVfCf5oLmun1BXy';
|
scope._walletPrivKey = 'Kz4CFSTgLzoYfMkt97BTBotUbZYXjMts6Ej9HbVfCf5oLmun1BXy';
|
||||||
|
|
||||||
ctrl.setSeedSource();
|
ctrl.setSeedSource();
|
||||||
|
|
||||||
|
console.log('[create.test.js.135]'); //TODO
|
||||||
ctrl.create(fakeForm);
|
ctrl.create(fakeForm);
|
||||||
|
|
||||||
|
console.log('[create.test.js.138]'); //TODO
|
||||||
|
|
||||||
should.not.exist(ctrl.error);
|
should.not.exist(ctrl.error);
|
||||||
mocks.go.walletHome.calledOnce.should.equal(true);
|
mocks.go.walletHome.calledOnce.should.equal(true);
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,8 @@ describe('disclaimerController', function() {
|
||||||
mnemonic: 'tunnel fork scare industry noble snow tank bullet over gesture nuclear next',
|
mnemonic: 'tunnel fork scare industry noble snow tank bullet over gesture nuclear next',
|
||||||
});
|
});
|
||||||
setTimeout(function() {
|
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();
|
done();
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@ mocks.$timeout = function(cb) {
|
||||||
};
|
};
|
||||||
|
|
||||||
mocks.modal = function() {};
|
mocks.modal = function() {};
|
||||||
|
mocks.ongoingProcess = {
|
||||||
|
set: sinon.stub(),
|
||||||
|
clear: sinon.stub(),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
mocks.setProfile = function(profile) {};
|
mocks.setProfile = function(profile) {};
|
||||||
|
|
@ -192,6 +196,7 @@ mocks.init = function(fixtures, controllerName, opts, done) {
|
||||||
ctrl = $controller(controllerName, {
|
ctrl = $controller(controllerName, {
|
||||||
$scope: scope,
|
$scope: scope,
|
||||||
$modal: mocks.modal,
|
$modal: mocks.modal,
|
||||||
|
ongoingProcess: mocks.ongoingProcess,
|
||||||
notification: mocks.notification,
|
notification: mocks.notification,
|
||||||
configService: _configService_,
|
configService: _configService_,
|
||||||
profileService: _profileService_,
|
profileService: _profileService_,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue