<commit_before>'use strict';

//https://github.com/angular/protractor/blob/master/docs/api.md
//GetAttribute() returns "boolean" values and will return either "true" or null
describe('Reports', function(){

    var Reports = require('../../../app/reports/reports-page.js');
    var reports = new Reports();

    describe('Reports List', function() {

        it('should have a Report Editor title', function(){
            reports.visitPage();
            expect(reports.getTitle()).toBe('Cell Store Manager');
        });

        it('Should show have at least one report', function() {
            reports.list.then(function(reportList){
                expect(reportList.length).toBeGreaterThan(0);
                reportList.forEach(function(report, index){
                    if(index > 0) {
                        var previousLastModified = reports.getLastModified(report);
                        var lastModified = reports.getLastModified(reportList[index - 1]);
                        expect(previousLastModified >= lastModified).toBeTruthy();
                    }
                });
            });
        });
    });

    describe('Report Selection', function() {

        it('should have all reports unchecked', function(){
            expect(reports.toggle.getAttribute('checked')).toBe(null);
            expect(reports.deleteBtn.isDisplayed()).toBe(false);
        });

        it('should select all reports when clicking on the toggle', function(){
            reports.toggle.click();
            expect(reports.toggle.getAttribute('checked')).toBe('true');
            expect(reports.deleteBtn.isDisplayed()).toBe(true);
            reports.checkboxes.each(function(element){
                expect(element.getAttribute('checked')).toBe('true');
            });
        });

        it('the toggle should be undeterminate if we unselect a report', function(){
            var report = reports.checkboxes.first();
            report.click();
            expect(report.getAttribute('checked')).toBe(null);
            reports.checkboxes.count().then(function(count){<commit_msg>:green_heart: Fix test.<commit_after>'use strict';

//https://github.com/angular/protractor/blob/master/docs/api.md
//GetAttribute() returns "boolean" values and will return either "true" or null
describe('Reports', function(){

    var Reports = require('../../../app/reports/reports-page.js');
    var reports = new Reports();

    describe('Reports List', function() {

        it('should have a Report Editor title', function(){
            reports.visitPage();
            expect(reports.getTitle()).toBe('Cell Store Manager');
        });

        it('Should show have at least one report', function() {
            reports.list.then(function(reportList){
                expect(reportList.length).toBeGreaterThan(0);
                reportList.forEach(function(report, index){
                    if(index > 0) {
                        var previousLastModified = reports.getLastModified(report);
                        var lastModified = reports.getLastModified(reportList[index - 1]);
                        expect(previousLastModified <= lastModified).toBeTruthy();
                    }
                });
            });
        });
    });

    describe('Report Selection', function() {

        it('should have all reports unchecked', function(){
            expect(reports.toggle.getAttribute('checked')).toBe(null);
            expect(reports.deleteBtn.isDisplayed()).toBe(false);
        });

        it('should select all reports when clicking on the toggle', function(){
            reports.toggle.click();
            expect(reports.toggle.getAttribute('checked')).toBe('true');
            expect(reports.deleteBtn.isDisplayed()).toBe(true);
            reports.checkboxes.each(function(element){
                expect(element.getAttribute('checked')).toBe('true');
            });
        });

        it('the toggle should be undeterminate if we unselect a report', function(){
            var report = reports.checkboxes.first();
            report.click();
            expect(report.getAttribute('checked')).toBe(null);
            reports.checkboxes.count().then(function(count){
{'fraction_non_alphanumeric': 0.13854562737642587, 'fraction_numerical': 0.0014258555133079848, 'mean_word_length': 2.2527047913446676, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '5774936', 'n_tokens_mistral': 1036, 'n_tokens_neox': 989, 'n_words': 207}