<commit_before>import Ember from "ember";
import startApp from "../helpers/start-app";
import {isVisible} from "ember-cli-test-helpers/tests/helpers/input";
import {isHidden} from "ember-cli-test-helpers/tests/helpers/input";
import {isTextInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isEmailInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isPasswordInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isTelInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isHiddenInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isCheckbox} from "ember-cli-test-helpers/tests/helpers/input";
import {isRadioButton} from "ember-cli-test-helpers/tests/helpers/input";
import {isRadioButtonWithText} from "ember-cli-test-helpers/tests/helpers/input";
import {isTextButton} from "ember-cli-test-helpers/tests/helpers/input";
import {isLink} from "ember-cli-test-helpers/tests/helpers/input";
import {isFocused} from "ember-cli-test-helpers/tests/helpers/input";
import {selectRadioButton} from "ember-cli-test-helpers/tests/helpers/input";
import {setCheckboxChecked} from "ember-cli-test-helpers/tests/helpers/input";

var application;

var RADIO_BUTTON = "input.radio-button";
var CHECKBOX_INPUT = "input.checkbox-input";

module("Acceptance: Usage", {
    setup: function() {
        application = startApp();
    },
    teardown: function() {
        Ember.run(application, "destroy");
    }
});

test("input with class text-input is an with type text", function() {
    visit("/");
    andThen(function() {
        isTextInput("input.text-input");
    });
});

test("input with class email-input is an input with type email", function() {
    visit("/");
    andThen(function() {
        isEmailInput("input.email-input");
    });
});

test("input with class password-input is an input with type password", function() {
    visit("/");
    andThen(function() {
        isPasswordInput("input.password-input");
    });
});

test("input with class tel-input is an input with type tel", function() {
    visit("/");
    andThen(function() {
        isTelInput("input.tel-input");
    });
});

test("input with class hidden-input is an input with type hidden", function() {
    visit("/");
    andThen(function() {
        isHiddenInput("hidden-input", "");
    });
});

test("input with class checkbox-input is an input with type checkbox", function() {
    visit("/");
    andThen(function() {
        isCheckbox(CHECKBOX_INPUT);
    });
});

test("inputs with class radio-button are an input with type radio and number of radio buttons is verified", function() {
    visit("/");
    andThen(function() {
        isRadioButton(RADIO_BUTTON, 2);
    });
});

test("input with class radio-button-text is an input with type radio and label with specified text", function() {
    visit("/");
    andThen(function() {
        isRadioButtonWithText("input.radio-button-text", "Radio Button Text");
    });
});

test("input with class text-button is an input with type button with specified text and optional type (defaulting to type=button)", function() {
    visit("/");
    andThen(function() {
        isTextButton("button.text-button", "Text Button");
        isTextButton("button.text-button-submit-type", "Text Button Submit Type", "submit");
    });
});

test("link with class link is an anchor tag with specified text and optional href", function() {
    visit("/");
    andThen(function() {
        isLink(".link", "link to foo");
        isLink(".link-with-href", "link to bar", "/bar");
    });
});

test("input with class focus-input is an input with the focus set", function() {
    visit("/");
    andThen(function() {
        isFocused("input.focus-input");
    });
});

test("selectRadioButton helper will select given radio button with provided selector and value", function() {
    visit("/");
    selectRadioButton(RADIO_BUTTON, "foo");
    andThen(function() {
        equal(find(RADIO_BUTTON + ":eq(0)").prop("checked"), true);
        equal(find(RADIO_BUTTON + ":eq(1)").prop("checked"), false);
    });
});

test("selectRadioButton helper will unselect all radio buttons for selector", function() {
    visit("/");
    selectRadioButton(RADIO_BUTTON, "foo");
    andThen(function() {
        equal(find(RADIO_BUTTON + ":eq(0)").prop("checked"), true);
        equal(find(RADIO_BUTTON + ":eq(1)").prop("checked"), false);
    });
    selectRadioButton(RADIO_BUTTON);
    andThen(function() {
        equal(find(RADIO_BUTTON).length, 2);
        equal(find(RADIO_BUTTON + ":eq(0)").prop("checked"), false);
        equal(find(RADIO_BUTTON + ":eq(1)").prop("checked"), false);
    });
});

test("setCheckboxChecked will check or uncheck the checkbox for given selector based on specified checked value", function() {
    visit("/");
    // checkbox is initially unchecked
    andThen(function() {
        equal(find(CHECKBOX_INPUT).prop("checked"), false);
    });
    // checkbox is checked
    setCheckboxChecked(CHECKBOX_INPUT, true);
    andThen(function() {
        equal(find(CHECKBOX_INPUT).prop("checked"), true);
    });
    // checkbox will remain checked
    setCheckboxChecked(CHECKBOX_INPUT, true);
    andThen(function() {
        equal(find(CHECKBOX_INPUT).prop("checked"), true);
    });
    // checkbox will be unchecked
    setCheckboxChecked(CHECKBOX_INPUT, false);
    andThen(function() {
        equal(find(CHECKBOX_INPUT).prop("checked"), false);
    });
});
<commit_msg>[TEST]: updating test to be QUnit 2.0 compliant<commit_after>import Ember from "ember";
import startApp from "../helpers/start-app";
import {isVisible} from "ember-cli-test-helpers/tests/helpers/input";
import {isHidden} from "ember-cli-test-helpers/tests/helpers/input";
import {isTextInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isEmailInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isPasswordInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isTelInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isHiddenInput} from "ember-cli-test-helpers/tests/helpers/input";
import {isCheckbox} from "ember-cli-test-helpers/tests/helpers/input";
import {isRadioButton} from "ember-cli-test-helpers/tests/helpers/input";
import {isRadioButtonWithText} from "ember-cli-test-helpers/tests/helpers/input";
import {isTextButton} from "ember-cli-test-helpers/tests/helpers/input";
import {isLink} from "ember-cli-test-helpers/tests/helpers/input";
import {isFocused} from "ember-cli-test-helpers/tests/helpers/input";
import {selectRadioButton} from "ember-cli-test-helpers/tests/helpers/input";
import {setCheckboxChecked} from "ember-cli-test-helpers/tests/helpers/input";

var application;

var RADIO_BUTTON = "input.radio-button";
var CHECKBOX_INPUT = "input.checkbox-input";

module("Acceptance: Usage", {
    setup: function() {
        application = startApp();
    },
    teardown: function() {
        Ember.run(application, "destroy");
    }
});

test("input with class text-input is an with type text", function(assert) {
    visit("/");
    andThen(function() {
        isTextInput("input.text-input");
    });
});

test("input with class email-input is an input with type email", function(assert) {
    visit("/");
    andThen(function() {
        isEmailInput("input.email-input");
    });
});

test("input with class password-input is an input with type password", function(assert) {
    visit("/");
    andThen(function() {
        isPasswordInput("input.password-input");
    });
});

test("input with class tel-input is an input with type tel", function(assert) {
    visit("/");
    andThen(function() {
        isTelInput("input.tel-input");
    });
});

test("input with class hidden-input is an input with type hidden", function(assert) {
    visit("/");
    andThen(function() {
        isHiddenInput("hidden-input", "");
    });
});

test("input with class checkbox-input is an input with type checkbox", function(assert) {
    visit("/");
    andThen(function() {
        isCheckbox(CHECKBOX_INPUT);
    });
});

test("inputs with class radio-button are an input with type radio and number of radio buttons is verified", function(assert) {
    visit("/");
    andThen(function() {
        isRadioButton(RADIO_BUTTON, 2);
    });
});

test("input with class radio-button-text is an input with type radio and label with specified text", function(assert) {
    visit("/");
    andThen(function() {
        isRadioButtonWithText("input.radio-button-text", "Radio Button Text");
    });
});

test("input with class text-button is an input with type button with specified text and optional type (defaulting to type=button)", function(assert) {
    visit("/");
    andThen(function() {
        isTextButton("button.text-button", "Text Button");
        isTextButton("button.text-button-submit-type", "Text Button Submit Type", "submit");
    });
});

test("link with class link is an anchor tag with specified text and optional href", function(assert) {
    visit("/");
    andThen(function() {
        isLink(".link", "link to foo");
        isLink(".link-with-href", "link to bar", "/bar");
    });
});

test("input with class focus-input is an input with the focus set", function(assert) {
    visit("/");
    andThen(function() {
        isFocused("input.focus-input");
    });
});

test("selectRadioButton helper will select given radio button with provided selector and value", function(assert) {
    visit("/");
    selectRadioButton(RADIO_BUTTON, "foo");
    andThen(function() {
        assert.equal(find(RADIO_BUTTON + ":eq(0)").prop("checked"), true);
        assert.equal(find(RADIO_BUTTON + ":eq(1)").prop("checked"), false);
    });
});

test("selectRadioButton helper will unselect all radio buttons for selector", function(assert) {
    visit("/");
    selectRadioButton(RADIO_BUTTON, "foo");
    andThen(function() {
        assert.equal(find(RADIO_BUTTON + ":eq(0)").prop("checked"), true);
        assert.equal(find(RADIO_BUTTON + ":eq(1)").prop("checked"), false);
    });
    selectRadioButton(RADIO_BUTTON);
    andThen(function() {
        assert.equal(find(RADIO_BUTTON).length, 2);
        assert.equal(find(RADIO_BUTTON + ":eq(0)").prop("checked"), false);
        assert.equal(find(RADIO_BUTTON + ":eq(1)").prop("checked"), false);
    });
});

test("setCheckboxChecked will check or uncheck the checkbox for given selector based on specified checked value", function(assert) {
    visit("/");
    // checkbox is initially unchecked
    andThen(function() {
        assert.equal(find(CHECKBOX_INPUT).prop("checked"), false);
    });
    // checkbox is checked
    setCheckboxChecked(CHECKBOX_INPUT, true);
    andThen(function() {
        assert.equal(find(CHECKBOX_INPUT).prop("checked"), true);
    });
    // checkbox will remain checked
    setCheckboxChecked(CHECKBOX_INPUT, true);
    andThen(function() {
        assert.equal(find(CHECKBOX_INPUT).prop("checked"), true);
    });
    // checkbox will be unchecked
    setCheckboxChecked(CHECKBOX_INPUT, false);
    andThen(function() {
        assert.equal(find(CHECKBOX_INPUT).prop("checked"), false);
    });
});

{'fraction_non_alphanumeric': 0.1602546856784145, 'fraction_numerical': 0.0016142050040355124, 'mean_word_length': 3.9257950530035335, 'pattern_counts': {'":': 12, '<': 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': '100999', 'n_tokens_mistral': 3303, 'n_tokens_neox': 3337, 'n_words': 783}