mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
Fix test failures and jshint errors
This commit is contained in:
parent
7b087d4a6c
commit
a804c854bf
@ -34,7 +34,8 @@
|
||||
"describe": false,
|
||||
"moment": false,
|
||||
"spyOn": false,
|
||||
"jasmine": false
|
||||
"jasmine": false,
|
||||
"dagre": false
|
||||
},
|
||||
"strict": false,
|
||||
"quotmark": false,
|
||||
|
@ -68,12 +68,6 @@ export default ['$scope', 'TemplatesService',
|
||||
|
||||
getNodes();
|
||||
|
||||
$scope.closeWorkflowMaker = () => {
|
||||
// Revert the data to the master which was created when the dialog was opened
|
||||
$scope.graphState.nodeTree = angular.copy($scope.graphStateMaster);
|
||||
$scope.closeDialog();
|
||||
};
|
||||
|
||||
$scope.saveWorkflowMaker = () => {
|
||||
|
||||
Wait('start');
|
||||
|
@ -28,7 +28,7 @@
|
||||
<div class="WorkflowMaker-titleText">{{strings.get('workflow_maker.TITLE')}} | {{ workflowJobTemplateObj.name }}</div>
|
||||
</div>
|
||||
<div class="WorkflowMaker-exitHolder">
|
||||
<button class="WorkflowMaker-exit" ng-click="closeWorkflowMaker()">
|
||||
<button class="WorkflowMaker-exit" ng-click="closeDialog()">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
</button>
|
||||
</div>
|
||||
@ -106,7 +106,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="WorkflowMaker-buttonHolder">
|
||||
<button type="button" class="btn btn-sm WorkflowMaker-cancelButton" ng-click="closeWorkflowMaker()"> {{:: strings.get('CLOSE') }}</button>
|
||||
<button type="button" class="btn btn-sm WorkflowMaker-cancelButton" ng-click="closeDialog()"> {{:: strings.get('CLOSE') }}</button>
|
||||
<button type="button" class="btn btn-sm WorkflowMaker-saveButton" ng-click="saveWorkflowMaker()" ng-show="workflowJobTemplateObj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate" ng-disabled="formState.showNodeForm || formState.showLinkForm"> {{:: strings.get('SAVE') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -30,11 +30,11 @@ describe('Controller: workflowResults', () => {
|
||||
$provide.value('ParseVariableString', function() {});
|
||||
$provide.value('i18n', { '_': (a) => { return a; } });
|
||||
$provide.provider('$stateProvider', { '$get': function() { return function() {}; } });
|
||||
$provide.service('WorkflowService', function($q) {
|
||||
$provide.service('WorkflowChartService', function($q) {
|
||||
return {
|
||||
buildTree: function() {
|
||||
generateArraysOfNodesAndLinks: function() {
|
||||
var deferred = $q.defer();
|
||||
deferred.resolve(treeData);
|
||||
deferred.resolve();
|
||||
return deferred.promise;
|
||||
}
|
||||
};
|
||||
@ -46,7 +46,6 @@ describe('Controller: workflowResults', () => {
|
||||
$rootScope = _$rootScope_;
|
||||
workflowResultsService = _workflowResultsService_;
|
||||
$interval = _$interval_;
|
||||
|
||||
}));
|
||||
|
||||
describe('elapsed timer', () => {
|
||||
|
@ -1,62 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
describe('Controller: WorkflowMaker', () => {
|
||||
// Setup
|
||||
let scope,
|
||||
WorkflowMakerController,
|
||||
TemplatesService,
|
||||
q,
|
||||
getWorkflowJobTemplateNodesDeferred;
|
||||
|
||||
beforeEach(angular.mock.module('awApp'));
|
||||
beforeEach(angular.mock.module('templates', () => {
|
||||
|
||||
TemplatesService = {
|
||||
getWorkflowJobTemplateNodes: function(){
|
||||
return angular.noop;
|
||||
}
|
||||
};
|
||||
|
||||
}));
|
||||
|
||||
beforeEach(angular.mock.inject( ($rootScope, $controller, $q) => {
|
||||
scope = $rootScope.$new();
|
||||
scope.closeDialog = jasmine.createSpy();
|
||||
scope.treeData = {
|
||||
data: {
|
||||
id: 1,
|
||||
canDelete: false,
|
||||
canEdit: false,
|
||||
canAddTo: true,
|
||||
isStartNode: true,
|
||||
unifiedJobTemplate: {
|
||||
name: "Workflow Launch"
|
||||
},
|
||||
children: [],
|
||||
deletedNodes: [],
|
||||
totalNodes: 0
|
||||
},
|
||||
nextIndex: 2
|
||||
};
|
||||
scope.workflowJobTemplateObj = {
|
||||
id: 1
|
||||
};
|
||||
q = $q;
|
||||
getWorkflowJobTemplateNodesDeferred = q.defer();
|
||||
TemplatesService.getWorkflowJobTemplateNodes = jasmine.createSpy('getWorkflowJobTemplateNodes').and.returnValue(getWorkflowJobTemplateNodesDeferred.promise);
|
||||
WorkflowMakerController = $controller('WorkflowMakerController', {
|
||||
$scope: scope,
|
||||
TemplatesService: TemplatesService
|
||||
});
|
||||
}));
|
||||
|
||||
describe('scope.closeWorkflowMaker()', () => {
|
||||
|
||||
it('should close the dialog', ()=>{
|
||||
scope.closeWorkflowMaker();
|
||||
expect(scope.closeDialog).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user