REFACTOR: Allow us to import `keyEvent`

This change should be quite safe as it only adds extra support for
imports rather than global variables.
This commit is contained in:
Robin Ward 2020-11-16 16:45:17 -05:00
parent 7fecad41db
commit 3fc5671e40
10 changed files with 16 additions and 9 deletions

View File

@ -1,6 +1,12 @@
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import { exists } from "discourse/tests/helpers/qunit-helpers";
import { fillIn, click, visit, currentURL } from "@ember/test-helpers";
import {
fillIn,
click,
keyEvent,
visit,
currentURL,
} from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance, count } from "discourse/tests/helpers/qunit-helpers";
import siteSettingFixture from "discourse/tests/fixtures/site-settings";

View File

@ -1,6 +1,6 @@
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import { exists } from "discourse/tests/helpers/qunit-helpers";
import { click, fillIn, visit } from "@ember/test-helpers";
import { click, fillIn, keyEvent, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";

View File

@ -1,4 +1,4 @@
import { visit, currentURL } from "@ember/test-helpers";
import { keyEvent, visit, currentURL } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";

View File

@ -1,5 +1,5 @@
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import { click, visit } from "@ember/test-helpers";
import { click, keyEvent, visit } from "@ember/test-helpers";
import { skip, test } from "qunit";
import I18n from "I18n";
import { run } from "@ember/runloop";

View File

@ -1,4 +1,4 @@
import { visit } from "@ember/test-helpers";
import { keyEvent, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import { withPluginApi } from "discourse/lib/plugin-api";

View File

@ -1,6 +1,6 @@
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import { exists } from "discourse/tests/helpers/qunit-helpers";
import { visit, fillIn, click } from "@ember/test-helpers";
import { keyEvent, visit, fillIn, click } from "@ember/test-helpers";
import { skip, test } from "qunit";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import {

View File

@ -1,6 +1,6 @@
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import { exists } from "discourse/tests/helpers/qunit-helpers";
import { click, fillIn, visit } from "@ember/test-helpers";
import { click, keyEvent, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";

View File

@ -1,6 +1,6 @@
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import { exists } from "discourse/tests/helpers/qunit-helpers";
import { click, fillIn, visit } from "@ember/test-helpers";
import { click, keyEvent, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
import I18n from "I18n";
import { withPluginApi } from "discourse/lib/plugin-api";

View File

@ -1,7 +1,7 @@
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import { moduleForComponent } from "ember-qunit";
import componentTest from "discourse/tests/helpers/component-test";
import { click, fillIn } from "@ember/test-helpers";
import { click, keyEvent, fillIn } from "@ember/test-helpers";
moduleForComponent("simple-list", { integration: true });

View File

@ -37,6 +37,7 @@ define("@ember/test-helpers", () => {
"currentRouteName",
"fillIn",
"setResolver",
"keyEvent",
].forEach((attr) => {
helpers[attr] = function () {
return window[attr](...arguments);