<commit_before><commit_msg>Initial version.<commit_after>define(["Team", "pilotstats/Action", "pilotstats/EntityFilter", "pilotstats/RangeFilter"], function(Team, Action, EntityFilter, RangeFilter)
{
    "use strict";
    QUnit.module("Action");

    QUnit.test("removeFilters()", function(assert)
    {
        // Setup.
        var filter = createRangeFilter();

        // Run.
        var result = Action.removeFilters(filter);

        // Verify.
        assert.ok(result);
        assert.equal(result.type, Action.REMOVE_FILTERS);
    });

    QUnit.test("setDefaultFilters()", function(assert)
    {
        // Setup.
        var filter = createRangeFilter();

        // Run.
        var result = Action.setDefaultFilters(filter);

        // Verify.
        assert.ok(result);
        assert.equal(result.type, Action.SET_DEFAULT_FILTERS);
    });

    QUnit.test("setFilters()", function(assert)
    {
        // Setup.
        var filters = [];
        filters.push(createEntityFilter());
        filters.push(createRangeFilter());

        // Run.
        var result = Action.setFilters(filters);

        // Verify.
        assert.ok(result);
        assert.equal(result.type, Action.SET_FILTERS);
        assert.equal(result.filters, filters);
    });

    function createEntityFilter()
    {
        var columnKey = "faction";
        var values = [Team.FIRST_ORDER, Team.IMPERIAL];

        return new EntityFilter(columnKey, values);
    }

    function createRangeFilter()
    {
        var columnKey = "pilotSkill";
        var isMinEnabled = false;
        var minValue = 1;
        var isMaxEnabled = false;
        var maxValue = 10;

        return new RangeFilter(columnKey, isMinEnabled, minValue, isMaxEnabled, maxValue);
    }
});
{'fraction_non_alphanumeric': 0.13033579965850883, 'fraction_numerical': 0.001707455890722823, 'mean_word_length': 2.3169811320754716, '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': '1691777', 'n_tokens_mistral': 513, 'n_tokens_neox': 500, 'n_words': 94}