<commit_before>'use strict';

describe('Controller: WorkflowAdd', () => {
    // Setup
    let scope,
        state,
        WorkflowAdd,
        ClearScope,
        Alert,
        GenerateForm,
        TemplatesService,
        q,
        getLabelsDeferred,
        createWorkflowJobTemplateDeferred,
        httpBackend,
        ProcessErrors,
        CreateSelect2,
        Wait,
        ParseTypeChange,
        ToJSON;

    beforeEach(angular.mock.module('Tower'));
    beforeEach(angular.mock.module('RestServices'));
    beforeEach(angular.mock.module('templates', ($provide) => {

        state = jasmine.createSpyObj('state', [
            '$get',
            'transitionTo',
            'go'
        ]);

        GenerateForm = jasmine.createSpyObj('GenerateForm', [
            'inject',
            'reset',
            'clearApiErrors',
            'applyDefaults'
        ]);

        TemplatesService = {
            getLabelOptions: function(){
                return angular.noop;
            },
            createWorkflowJobTemplate: function(){
                return angular.noop;
            }
        };

        ClearScope = jasmine.createSpy('ClearScope');
        Alert = jasmine.createSpy('Alert');
        ProcessErrors = jasmine.createSpy('ProcessErrors');
        CreateSelect2 = jasmine.createSpy('CreateSelect2');
        Wait = jasmine.createSpy('Wait');
        ParseTypeChange = jasmine.createSpy('ParseTypeChange');
        ToJSON = jasmine.createSpy('ToJSON');

        $provide.value('ClearScope', ClearScope);
        $provide.value('Alert', Alert);
        $provide.value('GenerateForm', GenerateForm);
        $provide.value('state', state);
        $provide.value('ProcessErrors', ProcessErrors);
        $provide.value('CreateSelect2', CreateSelect2);
        $provide.value('Wait', Wait);
        $provide.value('ParseTypeChange', ParseTypeChange);
        $provide.value('ToJSON', ToJSON);
    }));

    beforeEach(angular.mock.inject( ($rootScope, $controller, $q, $httpBackend, _state_, _ConfigService_, _ClearScope_, _GetChoices_, _Alert_, _GenerateForm_, _ProcessErrors_, _CreateSelect2_, _Wait_, _ParseTypeChange_, _ToJSON_) => {
        scope = $rootScope.$new();
        state = _state_;
        q = $q;
        ClearScope = _ClearScope_;
        Alert = _Alert_;
        GenerateForm = _GenerateForm_;
        httpBackend = $httpBackend;
        ProcessErrors = _ProcessErrors_;
        CreateSelect2 = _CreateSelect2_;
        Wait = _Wait_;
        getLabelsDeferred = q.defer();
        createWorkflowJobTemplateDeferred = q.defer();
        ParseTypeChange = _ParseTypeChange_;
        ToJSON = _ToJSON_;

        httpBackend
            .whenGET('/api')
            .respond(200, '');

        TemplatesService.getLabelOptions = jasmine.createSpy('getLabelOptions').and.returnValue(getLabelsDeferred.promise);
        TemplatesService.createWorkflowJobTemplate = jasmine.createSpy('createWorkflowJobTemplate').and.returnValue(createWorkflowJobTemplateDeferred.promise);

        WorkflowAdd = $controller('WorkflowAdd', {
            $scope: scope,
            $state: state,
            ClearScope: ClearScope,
            Alert: Alert,
            GenerateForm: GenerateForm,
            TemplatesService: TemplatesService,
            ProcessErrors: ProcessErrors,
            CreateSelect2: CreateSelect2,<commit_msg>Fixed unit test failure<commit_after>'use strict';

describe('Controller: WorkflowAdd', () => {
    // Setup
    let scope,
        state,
        WorkflowAdd,
        ClearScope,
        Alert,
        GenerateForm,
        TemplatesService,
        q,
        getLabelsDeferred,
        createWorkflowJobTemplateDeferred,
        httpBackend,
        ProcessErrors,
        CreateSelect2,
        Wait,
        ParseTypeChange,
        ToJSON;

    beforeEach(angular.mock.module('Tower'));
    beforeEach(angular.mock.module('RestServices'));
    beforeEach(angular.mock.module('templates', ($provide) => {

        state = jasmine.createSpyObj('state', [
            '$get',
            'transitionTo',
            'go'
        ]);

        GenerateForm = jasmine.createSpyObj('GenerateForm', [
            'inject',
            'reset',
            'clearApiErrors',
            'applyDefaults'
        ]);

        TemplatesService = {
            getLabelOptions: function(){
                return angular.noop;
            },
            createWorkflowJobTemplate: function(){
                return angular.noop;
            }
        };

        ClearScope = jasmine.createSpy('ClearScope');
        Alert = jasmine.createSpy('Alert');
        ProcessErrors = jasmine.createSpy('ProcessErrors');
        CreateSelect2 = jasmine.createSpy('CreateSelect2');
        Wait = jasmine.createSpy('Wait');
        ParseTypeChange = jasmine.createSpy('ParseTypeChange');
        ToJSON = jasmine.createSpy('ToJSON');

        $provide.value('ClearScope', ClearScope);
        $provide.value('Alert', Alert);
        $provide.value('GenerateForm', GenerateForm);
        $provide.value('state', state);
        $provide.value('ProcessErrors', ProcessErrors);
        $provide.value('CreateSelect2', CreateSelect2);
        $provide.value('Wait', Wait);
        $provide.value('ParseTypeChange', ParseTypeChange);
        $provide.value('ToJSON', ToJSON);
    }));

    beforeEach(angular.mock.inject( ($rootScope, $controller, $q, $httpBackend, _state_, _ConfigService_, _ClearScope_, _GetChoices_, _Alert_, _GenerateForm_, _ProcessErrors_, _CreateSelect2_, _Wait_, _ParseTypeChange_, _ToJSON_) => {
        scope = $rootScope.$new();
        state = _state_;
        q = $q;
        ClearScope = _ClearScope_;
        Alert = _Alert_;
        GenerateForm = _GenerateForm_;
        httpBackend = $httpBackend;
        ProcessErrors = _ProcessErrors_;
        CreateSelect2 = _CreateSelect2_;
        Wait = _Wait_;
        getLabelsDeferred = q.defer();
        createWorkflowJobTemplateDeferred = q.defer();
        ParseTypeChange = _ParseTypeChange_;
        ToJSON = _ToJSON_;

        httpBackend
            .whenGET('/api')
            .respond(200, '');

        httpBackend
            .whenGET('/static/languages/en_US.json')
            .respond(200, '');

        TemplatesService.getLabelOptions = jasmine.createSpy('getLabelOptions').and.returnValue(getLabelsDeferred.promise);
        TemplatesService.createWorkflowJobTemplate = jasmine.createSpy('createWorkflowJobTemplate').and.returnValue(createWorkflowJobTemplateDeferred.promise);

        WorkflowAdd = $controller('WorkflowAdd', {
            $scope: scope,
            $state: state,
            ClearScope: ClearScope,
            Alert: Alert,
            GenerateForm: GenerateForm,
            TemplatesService: TemplatesService,
            ProcessErrors: ProcessErrors,
            CreateSelect2: CreateSelect2,
{'fraction_non_alphanumeric': 0.11322951535438801, 'fraction_numerical': 0.004220637461795954, 'mean_word_length': 2.353831137140068, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4821389', 'n_tokens_mistral': 1897, 'n_tokens_neox': 1816, 'n_words': 299}