<commit_before>describe('Dataset list controller', function () {
    'use strict';

    var createController, scope;
    var datasets = [
        {id: '<KEY>', name: 'Customers (50 lines)'},
        {id: '<KEY>', name: 'Us states'},
        {id: 'cf98d83dcb9437', name: 'Customers (1K lines)'}
    ];
    var refreshedDatasets = [
        {id: '<KEY>', name: 'Customers (50 lines)'},
        {id: '<KEY>', name: 'Us states'}
    ];

    beforeEach(module('data-prep.dataset-list'));

    beforeEach(inject(function ($rootScope, $controller, $q, DatasetListService, PreparationListService, PlaygroundService, MessageService) {
        var datasetsValues = [datasets, refreshedDatasets];
        scope = $rootScope.$new();

        createController = function () {
            var ctrl = $controller('DatasetListCtrl', {
                $scope: scope
            });
            return ctrl;
        };

        spyOn(DatasetListService, 'refreshDatasets').and.callFake(function () {
            DatasetListService.datasets = datasetsValues.shift();
            return $q.when(DatasetListService.datasets);
        });
        spyOn(PreparationListService, 'getPreparationsPromise').and.returnValue($q.when(true));
        spyOn(PreparationListService, 'refreshPreparations').and.returnValue($q.when(true));

        spyOn(PlaygroundService, 'initPlayground').and.returnValue($q.when(true));
        spyOn(PlaygroundService, 'show').and.callThrough();
        spyOn(MessageService, 'error').and.returnValue(null);
    }));

    afterEach(inject(function($stateParams) {
        $stateParams.datasetid = null;
    }));

    it('should get dataset on creation', inject(function (DatasetListService) {
        //when
        var ctrl = createController();
        scope.$digest();

        //then
        expect(DatasetListService.refreshDatasets).toHaveBeenCalled();
        expect(ctrl.datasets).toBe(datasets);
    }));

    it('should refresh preparations to set default preparation on creation', inject(function (PreparationListService) {
        //when
        var ctrl = createController();
        scope.$digest();
<commit_msg>TDP-90  | remove one warning<commit_after>describe('Dataset list controller', function () {
    'use strict';

    var createController, scope;
    var datasets = [
        {id: '<KEY>', name: 'Customers (50 lines)'},
        {id: 'ab45f893d8e923', name: 'Us states'},
        {id: 'cf98d83dcb9437', name: 'Customers (1K lines)'}
    ];
    var refreshedDatasets = [
        {id: 'ec4834d9bc2af8', name: 'Customers (50 lines)'},
        {id: 'ab45f893d8e923', name: 'Us states'}
    ];

    beforeEach(module('data-prep.dataset-list'));

    beforeEach(inject(function ($rootScope, $controller, $q, DatasetListService, PreparationListService, PlaygroundService, MessageService) {
        var datasetsValues = [datasets, refreshedDatasets];
        scope = $rootScope.$new();

        createController = function () {
            var ctrl = $controller('DatasetListCtrl', {
                $scope: scope
            });
            return ctrl;
        };

        spyOn(DatasetListService, 'refreshDatasets').and.callFake(function () {
            DatasetListService.datasets = datasetsValues.shift();
            return $q.when(DatasetListService.datasets);
        });
        spyOn(PreparationListService, 'getPreparationsPromise').and.returnValue($q.when(true));
        spyOn(PreparationListService, 'refreshPreparations').and.returnValue($q.when(true));

        spyOn(PlaygroundService, 'initPlayground').and.returnValue($q.when(true));
        spyOn(PlaygroundService, 'show').and.callThrough();
        spyOn(MessageService, 'error').and.returnValue(null);
    }));

    afterEach(inject(function($stateParams) {
        $stateParams.datasetid = null;
    }));

    it('should get dataset on creation', inject(function (DatasetListService) {
        //when
        var ctrl = createController();
        scope.$digest();

        //then
        expect(DatasetListService.refreshDatasets).toHaveBeenCalled();
        expect(ctrl.datasets).toBe(datasets);
    }));

    it('should refresh preparations to set default preparation on creation', inject(function (PreparationListService) {
        //when
        createController();
        scope.$digest();

{'fraction_non_alphanumeric': 0.14052668375670008, 'fraction_numerical': 0.012351433232346772, 'mean_word_length': 3.0187265917602994, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '3438769', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1220, 'n_words': 231}