<commit_before>/* global loadDateFixture, appendChartID */
describe('dc.inputFilter', function () {
    var dateFixture;
    var id, chart, data;
    var dimension, group;
    var countryDimension;

    beforeEach(function () {
        dateFixture = loadDateFixture();
        data = crossfilter(dateFixture);
        dimension = data.dimension(function (d) {
            return d.countrycode.toLowerCase() + ' ' + d.state.toLowerCase();
        });
        group = dimension.group().reduceSum(function (d) {
            return 1;
        });
        countryDimension = data.dimension(function (d) {
            return d.countrycode;
        });

        id = 'input-filter';
        appendChartID(id);
        chart = dc.inputFilter('#' + id)
            .dimension(dimension)
            .group(group);
        chart.render();
    });

    describe('creation', function () {
        it('generates something', function () {
            expect(chart).not.toBeNull();
        });
        it('registers', function () {
            expect(dc.hasChart(chart)).toBeTruthy();
        });
        it('sets an input field', function () {
            expect(chart.selectAll('input').nodes().length).toEqual(1);
        });
        it('doesn\'t filter by default', function () {
            expect(chart.dimension().top(1000).length).toEqual(100);
        });
    });

    describe('default accessor functions', function () {
        it('exists for html()', function () {
            var html = chart.html();
            expect(typeof html).toBe('function');
        });
        it('exists for normalize()', function () {
            var normalize = chart.normalize();
            expect(typeof normalize).toBe('function');
        });
        it('exists for filterFunction()', function () {
            var filterFunction = chart.filterFunction();
            expect(typeof filterFunction).toBe('function');
        });
        it('exists for throttleDuration()', function () {
            var throttleDuration = chart.throttleDuration();
            expect(typeof throttleDuration).toBe('number');
            expect(throttleDuration).toBe(200);
        });
    });

    describe('change the html search field', function () {
        it('generates something', function () {
            expect(chart).not.toBeNull();
        });
        it('registers', function () {
            expect(dc.hasChart(chart)).toBeTruthy();
        });
        it('sets an input field', function () {
            expect(chart.selectAll('input').nodes().length).toEqual(1);
        });
        it('doesn\'t filter by default', function () {
            expect(chart.dimension().top(1000).length).toEqual(100);
        });<commit_msg>Tests passing<commit_after>/* global loadDateFixture, appendChartID */
describe('dc.inputFilter', function () {
    var dateFixture;
    var id, chart, data;
    var dimension, group;
    var countryDimension;

    beforeEach(function () {
        dateFixture = loadDateFixture();
        data = crossfilter(dateFixture);
        dimension = data.dimension(function (d) {
            return d.countrycode.toLowerCase() + ' ' + d.state.toLowerCase();
        });
        group = dimension.group().reduceSum(function (d) {
            return 1;
        });
        countryDimension = data.dimension(function (d) {
            return d.countrycode;
        });

        id = 'input-filter';
        appendChartID(id);
        chart = dc.inputFilter('#' + id)
            .dimension(dimension)
            .group(group);
        chart.render();
    });

    describe('creation', function () {
        it('generates something', function () {
            expect(chart).not.toBeNull();
        });
        it('registers', function () {
            expect(dc.hasChart(chart)).toBeTruthy();
        });
        it('sets an input field', function () {
            expect(chart.selectAll('input').nodes().length).toEqual(1);
        });
        it('doesn\'t filter by default', function () {
            expect(chart.dimension().top(1000).length).toEqual(10);
        });
    });

    describe('default accessor functions', function () {
        it('exists for html()', function () {
            var html = chart.html();
            expect(typeof html).toBe('function');
        });
        it('exists for normalize()', function () {
            var normalize = chart.normalize();
            expect(typeof normalize).toBe('function');
        });
        it('exists for filterFunction()', function () {
            var filterFunction = chart.filterFunction();
            expect(typeof filterFunction).toBe('function');
        });
        it('exists for throttleDuration()', function () {
            var throttleDuration = chart.throttleDuration();
            expect(typeof throttleDuration).toBe('number');
            expect(throttleDuration).toBe(200);
        });
    });

    describe('change the html search field', function () {
        it('generates something', function () {
            expect(chart).not.toBeNull();
        });
        it('registers', function () {
            expect(dc.hasChart(chart)).toBeTruthy();
        });
        it('sets an input field', function () {
            expect(chart.selectAll('input').nodes().length).toEqual(1);
        });
        it('doesn\'t filter by default', function () {
            expect(chart.dimension().top(1000).length).toEqual(10);
        });
{'fraction_non_alphanumeric': 0.1540170307293595, 'fraction_numerical': 0.007034431691965938, 'mean_word_length': 2.1449359720605354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '88134', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1375, 'n_words': 269}