got tests to pass

This commit is contained in:
David Baldwynn 2017-10-07 00:35:41 -07:00
parent 3ebb4eebff
commit e620769d32
2 changed files with 3 additions and 13 deletions

View File

@ -24,7 +24,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
forceHelperSize: true,
forcePlaceholderSize: true,
update: function(e, ui) {
$rootScope.update(false, $scope.myform, true, false, function(err){
$scope.update(false, $scope.myform, true, false, function(err){
});
},
};
@ -336,7 +336,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
// Delete particular field on button click
$scope.deleteField = function (field_index) {
$scope.myform.form_fields.splice(field_index, 1);
$rootScope.update(false, $scope.myform, false, true, null);
$scope.update(false, $scope.myform, false, true, null);
};
$scope.duplicateField = function(field_index){
@ -346,7 +346,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
//Insert field at selected index
$scope.myform.form_fields.push(currField);
$rootScope.update(false, $scope.myform, false, true, null);
$scope.update(false, $scope.myform, false, true, null);
};
//Populate AddField with all available form field types

View File

@ -60,22 +60,13 @@
var newFakeModal = function(){
var result = {
opened: true,
result: {
then: function(confirmCallback, cancelCallback) {
//Store the callbacks for later when the user clicks on the OK or Cancel button of the dialog
this.confirmCallBack = confirmCallback;
this.cancelCallback = cancelCallback;
}
},
close: function( item ) {
//The user clicked OK on the modal dialog, call the stored confirm callback with the selected item
this.opened = false;
this.result.confirmCallBack( item );
},
dismiss: function( type ) {
//The user clicked cancel on the modal dialog, call the stored cancel callback
this.opened = false;
this.result.cancelCallback( type );
}
};
return result;
@ -173,7 +164,6 @@
beforeEach(inject(function($uibModal) {
var modal = newFakeModal();
spyOn($uibModal, 'open').and.returnValue(modal);
//spyOn($uibModal, 'close').and.callFake(modal.close());
}));
// The injector ignores leading and trailing underscores here (i.e. _$httpBackend_).