<commit_before>'use strict';

describe('Directives', function(){
    var templateCache, scope, element, Directive,
        templateUrl = 'ion-tree-list.tmpl.html',
        items = [
            {
                name: 'task 1',
                tree: [
                    {
                        name: 'task 1.1'
                    }
                ]
            },
            {
                name: 'task 2'
            },
            {
                name: 'task 3'
            }
        ];

    beforeEach(module('ion-tree-list'));
    beforeEach(module(templateUrl));
    beforeEach(inject(
        function($rootScope, $compile, $templateCache, $injector){
            Directive = function(){
                this.directive = $injector.get('ionTreeListDirective');
                this.directive[0].templateUrl = templateUrl;  // Override baseUrl for custom templates
                this.element = $compile(angular.element('<ion-tree-list items="items"></ion-tree-list>'))(scope);
                this.element.scope().$apply();
                this.isolateScope = this.element.isolateScope();
            };

            scope = $rootScope.$new();
            scope.items = items;
            templateCache = $templateCache
        }
    ));

    describe('ion-tree-list', function(){

        var d;

        beforeEach(function(){
            d = new Directive('ionTreeList')
        });

        it('has the ion tree list directive', function(){
            expect(d.directive).toBeDefined()
        });

        it('logs a template for cart-item.html', function(){
            expect(templateCache.get('ion-tree-list.tmpl.html')).toBeDefined()
        });

        it('has an isolate scope', function() {
            expect(d.isolateScope).toBeDefined()
        });

        it('has an isolate scope with a "items" property on it', function() {
            expect(d.isolateScope.items).toBeDefined()
        });

        it('has an moveItem method', function(){
            expect(typeof d.isolateScope.moveItem).toBe('function')
        });

        it('items have the same of elements as in scope', function(){
            expect(d.element[0].querySelectorAll('.item').length).toBe(4);
        });

        it('items has the correct className assigned', function(){
            var list = d.element[0].children[3].children[0],
                classNameFirst = list.children[0].className,
                classNameFirstNested = list.children[1].children[0].className;

            expect(classNameFirst).toBe('item depth-1');
            expect(classNameFirstNested).toBe('item depth-2');
        })
    })
});<commit_msg>Updated tests with done callback (not exiting in CI drone.io)<commit_after>'use strict';

describe('Directives', function(){
    var templateCache, scope, element, Directive,
        templateUrl = 'ion-tree-list.tmpl.html',
        items = [
            {
                name: 'task 1',
                tree: [
                    {
                        name: 'task 1.1'
                    }
                ]
            },
            {
                name: 'task 2'
            },
            {
                name: 'task 3'
            }
        ];

    beforeEach(module('ion-tree-list'));
    beforeEach(module(templateUrl));
    beforeEach(inject(
        function($rootScope, $compile, $templateCache, $injector){
            Directive = function(){
                this.directive = $injector.get('ionTreeListDirective');
                this.directive[0].templateUrl = templateUrl;  // Override baseUrl for custom templates
                this.element = $compile(angular.element('<ion-tree-list items="items"></ion-tree-list>'))(scope);
                this.element.scope().$apply();
                this.isolateScope = this.element.isolateScope();
            };

            scope = $rootScope.$new();
            scope.items = items;
            templateCache = $templateCache
        }
    ));

    describe('ion-tree-list', function(){

        var d;

        beforeEach(function(){
            d = new Directive('ionTreeList')
        });

        it('has the ion tree list directive', function(done){
            expect(d.directive).toBeDefined();
            done()
        });

        it('logs a template for cart-item.html', function(done){
            expect(templateCache.get('ion-tree-list.tmpl.html')).toBeDefined();
            done()
        });

        it('has an isolate scope', function(done) {
            expect(d.isolateScope).toBeDefined();
            done()
        });

        it('has an isolate scope with a "items" property on it', function(done) {
            expect(d.isolateScope.items).toBeDefined();
            done()
        });

        it('has an moveItem method', function(done){
            expect(typeof d.isolateScope.moveItem).toBe('function');
            done();
        });

        it('items have the same of elements as in scope', function(done){
            expect(d.element[0].querySelectorAll('.item').length).toBe(4);
            done()
        });

        it('items has the correct className assigned', function(done){
            var list = d.element[0].children[3].children[0],
                classNameFirst = list.children[0].className,
                classNameFirstNested = list.children[1].children[0].className;

            expect(classNameFirst).toBe('item depth-1');
            expect(classNameFirstNested).toBe('item depth-2');
            done()
        })
    })
});
{'fraction_non_alphanumeric': 0.13666969972702456, 'fraction_numerical': 0.005823475887170155, 'mean_word_length': 1.704724409448819, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7567571', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1398, 'n_words': 280}