Skip to content

A platform for community discussion. Free, open, simple.

DEV: Avoid using globals (#14909)

Jarek Radoszbdd2c888b0f4
diff --git a/.eslintrc b/.eslintrc
index 62dbb92b839..511724fb508 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -5,15 +5,41 @@
"eol-last": 2
},
"globals": {
+ "_": "off",
+ "acceptance": "off",
+ "asyncRender": "off",
+ "bootbox": "off",
+ "click": "off",
+ "count": "off",
+ "currentPath": "off",
+ "currentRouteName": "off",
+ "currentURL": "off",
+ "currentUser": "off",
+ "Discourse": "off",
+ "exists": "off",
+ "fillIn": "off",
+ "find": "off",
+ "getSettledState": "off",
+ "hasModule": "off",
+ "invisible": "off",
"jQuery": "off",
+ "keyboardHelper": "off",
+ "keyEvent": "off",
"moduleFor": "off",
"moduleForComponent": "off",
- "testStart": "off",
- "testDone": "off",
+ "pauseTest": "off",
+ "Pretender": "off",
+ "query": "off",
+ "queryAll": "off",
+ "QUnit": "off",
+ "sandbox": "off",
"sinon": "off",
- "currentURL": "off",
- "invisible": "off",
+ "test": "off",
+ "testDone": "off",
+ "testStart": "off",
+ "triggerEvent": "off",
"visible": "off",
- "count": "off"
+ "visit": "off",
+ "waitUntil": "off"
}
}
diff --git a/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js b/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js
index 58760b4a136..6c23a361098 100644
--- a/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js
+++ b/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js
@@ -2,6 +2,7 @@ import { COMPONENTS, THEMES } from "admin/models/theme";
import I18n from "I18n";
import Route from "@ember/routing/route";
import { scrollTop } from "discourse/mixins/scroll-top";
+import bootbox from "bootbox";
export function showUnassignedComponentWarning(theme, callback) {
bootbox.confirm(
diff --git a/app/assets/javascripts/discourse/app/components/pick-files-button.js b/app/assets/javascripts/discourse/app/components/pick-files-button.js
index a451c67e805..9ab6465bcd8 100644
--- a/app/assets/javascripts/discourse/app/components/pick-files-button.js
+++ b/app/assets/javascripts/discourse/app/components/pick-files-button.js
@@ -1,8 +1,9 @@
import Component from "@ember/component";
import { action } from "@ember/object";
import { empty } from "@ember/object/computed";
-import { bind, default as computed } from "discourse-common/utils/decorators";
+import computed, { bind } from "discourse-common/utils/decorators";
import I18n from "I18n";
+import bootbox from "bootbox";
export default Component.extend({
classNames: ["pick-files-button"],
diff --git a/app/assets/javascripts/discourse/app/controllers/grant-admin-second-factor.js b/app/assets/javascripts/discourse/app/controllers/grant-admin-second-factor.js
index 2debd00feb6..62c000b4731 100644
--- a/app/assets/javascripts/discourse/app/controllers/grant-admin-second-factor.js
+++ b/app/assets/javascripts/discourse/app/controllers/grant-admin-second-factor.js
@@ -5,6 +5,7 @@ import { getWebauthnCredential } from "discourse/lib/webauthn";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { SECOND_FACTOR_METHODS } from "discourse/models/user";
import I18n from "I18n";
+import bootbox from "bootbox";
export default Controller.extend(ModalFunctionality, {
showSecondFactor: false,
diff --git a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
index 1ae7bd28d22..c7a95a60945 100644
--- a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
+++ b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
@@ -18,6 +18,7 @@ import {
validateUploadedFile,
} from "discourse/lib/uploads";
import { cacheShortUploadUrl } from "pretty-text/upload-short-url";
+import bootbox from "bootbox";
// Note: This mixin is used _in addition_ to the ComposerUpload mixin
// on the composer-editor component. It overrides some, but not all,
diff --git a/app/assets/javascripts/discourse/app/mixins/composer-upload.js b/app/assets/javascripts/discourse/app/mixins/composer-upload.js
index 24fae9e1864..cee453f6d02 100644
--- a/app/assets/javascripts/discourse/app/mixins/composer-upload.js
+++ b/app/assets/javascripts/discourse/app/mixins/composer-upload.js
@@ -13,6 +13,7 @@ import {
validateUploadedFiles,
} from "discourse/lib/uploads";
import { cacheShortUploadUrl } from "pretty-text/upload-short-url";
+import bootbox from "bootbox";
export default Mixin.create({
_xhr: null,
diff --git a/app/assets/javascripts/discourse/app/mixins/uppy-upload.js b/app/assets/javascripts/discourse/app/mixins/uppy-upload.js
index 941fe7839a9..3fe51eae6fe 100644
--- a/app/assets/javascripts/discourse/app/mixins/uppy-upload.js
+++ b/app/assets/javascripts/discourse/app/mixins/uppy-upload.js
@@ -16,6 +16,7 @@ import UppyChecksum from "discourse/lib/uppy-checksum-plugin";
import UppyS3Multipart from "discourse/mixins/uppy-s3-multipart";
import { on } from "discourse-common/utils/decorators";
import { warn } from "@ember/debug";
+import bootbox from "bootbox";
export const HUGE_FILE_THRESHOLD_BYTES = 104_857_600; // 100MB
diff --git a/app/assets/javascripts/discourse/app/models/site.js b/app/assets/javascripts/discourse/app/models/site.js
index 9fc38c92de0..9b92108149c 100644
--- a/app/assets/javascripts/discourse/app/models/site.js
+++ b/app/assets/javascripts/discourse/app/models/site.js
@@ -224,6 +224,7 @@ Site.reopenClass(Singleton, {
if (typeof Discourse !== "undefined") {
let warned = false;
+ // eslint-disable-next-line no-undef
Object.defineProperty(Discourse, "Site", {
get() {
if (!warned) {
diff --git a/app/assets/javascripts/discourse/app/models/user.js b/app/assets/javascripts/discourse/app/models/user.js
index 400d9f317c1..b9b92bc0b2b 100644
--- a/app/assets/javascripts/discourse/app/models/user.js
+++ b/app/assets/javascripts/discourse/app/models/user.js
@@ -1125,6 +1125,7 @@ User.reopenClass(Singleton, {
if (typeof Discourse !== "undefined") {
let warned = false;
+ // eslint-disable-next-line no-undef
Object.defineProperty(Discourse, "User", {
get() {
if (!warned) {
diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js
index 31c994435dc..644ee8f2569 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js
@@ -2,6 +2,7 @@ import {
acceptance,
count,
exists,
+ query,
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
import { click, fillIn, visit } from "@ember/test-helpers";
@@ -91,16 +92,16 @@ acceptance("Admin - Watched Words", function (needs) {
await visit("/admin/customize/watched_words/action/replace");
await click(".watched-word-test");
await fillIn(".modal-body textarea", "Hi there!");
- assert.strictEqual(find(".modal-body li .match").text(), "Hi");
- assert.strictEqual(find(".modal-body li .replacement").text(), "hello");
+ assert.strictEqual(query(".modal-body li .match").innerText, "Hi");
+ assert.strictEqual(query(".modal-body li .replacement").innerText, "hello");
});
test("test modal - tag", async function (assert) {
await visit("/admin/customize/watched_words/action/tag");
await click(".watched-word-test");
await fillIn(".modal-body textarea", "Hello world!");
- assert.strictEqual(find(".modal-body li .match").text(), "Hello");
- assert.strictEqual(find(".modal-body li .tag").text(), "greeting");
+ assert.strictEqual(query(".modal-body li .match").innerText, "Hello");
+ assert.strictEqual(query(".modal-body li .tag").innerText, "greeting");
});
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-edit-conflict-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-edit-conflict-test.js
index 7bb48699321..651951bd0bc 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/composer-edit-conflict-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-edit-conflict-test.js
@@ -1,7 +1,7 @@
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
import { click, fillIn, visit } from "@ember/test-helpers";
import I18n from "I18n";
-import { test } from "qunit";
+import { skip, test } from "qunit";
acceptance("Composer - Edit conflict", function (needs) {
needs.user();
@@ -14,26 +14,23 @@ acceptance("Composer - Edit conflict", function (needs) {
});
});
- QUnit.skip(
- "Edit a post that causes an edit conflict",
- async function (assert) {
- await visit("/t/internationalization-localization/280");
- await click(".topic-post:nth-of-type(1) button.show-more-actions");
- await click(".topic-post:nth-of-type(1) button.edit");
- await fillIn(".d-editor-input", "this will 409");
- await click("#reply-control button.create");
- assert.strictEqual(
- queryAll("#reply-control button.create").text().trim(),
- I18n.t("composer.overwrite_edit"),
- "it shows the overwrite button"
- );
- assert.ok(
- queryAll("#draft-status .d-icon-user-edit"),
- "error icon should be there"
- );
- await click(".modal .btn-primary");
- }
- );
+ skip("Edit a post that causes an edit conflict", async function (assert) {
+ await visit("/t/internationalization-localization/280");
+ await click(".topic-post:nth-of-type(1) button.show-more-actions");
+ await click(".topic-post:nth-of-type(1) button.edit");
+ await fillIn(".d-editor-input", "this will 409");
+ await click("#reply-control button.create");
+ assert.strictEqual(
+ queryAll("#reply-control button.create").text().trim(),
+ I18n.t("composer.overwrite_edit"),
+ "it shows the overwrite button"
+ );
+ assert.ok(
+ queryAll("#draft-status .d-icon-user-edit"),
+ "error icon should be there"
+ );
+ await click(".modal .btn-primary");
+ });
test("Should not send originalText when posting a new reply", async function (assert) {
await visit("/t/internationalization-localization/280");
diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js
index b011c2887fe..44d87a77d37 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js
@@ -379,11 +379,9 @@ acceptance("Composer", function (needs) {
// at this point, request is in flight, so post is staged
assert.strictEqual(count(".topic-post.staged"), 1);
- assert.ok(
- find(".topic-post:nth-of-type(1)")[0].className.includes("staged")
- );
+ assert.ok(query(".topic-post:nth-of-type(1)").className.includes("staged"));
assert.strictEqual(
- find(".topic-post.staged .cooked").text().trim(),
+ query(".topic-post.staged .cooked").innerText.trim(),
"will return empty json"
);
@@ -394,26 +392,23 @@ acceptance("Composer", function (needs) {
assert.strictEqual(count(".topic-post.staged"), 0);
});
- QUnit.skip(
- "Editing a post can rollback to old content",
- async function (assert) {
- await visit("/t/internationalization-localization/280");
- await click(".topic-post:nth-of-type(1) button.show-more-actions");
- await click(".topic-post:nth-of-type(1) button.edit");
+ skip("Editing a post can rollback to old content", async function (assert) {
+ await visit("/t/internationalization-localization/280");
+ await click(".topic-post:nth-of-type(1) button.show-more-actions");
+ await click(".topic-post:nth-of-type(1) button.edit");
- await fillIn(".d-editor-input", "this will 409");
- await fillIn("#reply-title", "This is the new text for the title");
- await click("#reply-control button.create");
+ await fillIn(".d-editor-input", "this will 409");
+ await fillIn("#reply-title", "This is the new text for the title");
+ await click("#reply-control button.create");
- assert.ok(!exists(".topic-post.staged"));
- assert.strictEqual(
- find(".topic-post .cooked")[0].innerText,
- "Any plans to support localization of UI elements, so that I (for example) could set up a completely German speaking forum?"
- );
+ assert.ok(!exists(".topic-post.staged"));
+ assert.strictEqual(
+ query(".topic-post .cooked").innerText,
+ "Any plans to support localization of UI elements, so that I (for example) could set up a completely German speaking forum?"
+ );
- await click(".bootbox.modal .btn-primary");
- }
- );
+ await click(".bootbox.modal .btn-primary");
+ });
test("Composer can switch between edits", async function (assert) {
await visit("/t/this-is-a-test-topic/9");
diff --git a/app/assets/javascripts/discourse/tests/acceptance/create-invite-modal-test.js b/app/assets/javascripts/discourse/tests/acceptance/create-invite-modal-test.js
index 71a33eab9a5..27d6abfe897 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/create-invite-modal-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/create-invite-modal-test.js
@@ -4,6 +4,7 @@ import {
count,
exists,
fakeTime,
+ query,
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit";
@@ -53,7 +54,7 @@ acceptance("Invites - Create & Edit Invite Modal", function (needs) {
await visit("/u/eviltrout/invited/pending");
await click(".user-invite-buttons .btn:first-child");
assert.strictEqual(
- find("input.invite-link")[0].value,
+ query("input.invite-link").value,
"http://example.com/invites/52641ae8878790bc7b79916247cfe6ba",
"shows an invite link when modal is opened"
);
@@ -102,7 +103,7 @@ acceptance("Invites - Create & Edit Invite Modal", function (needs) {
await fillIn("#invite-email", "error");
await click(".invite-link .btn");
assert.strictEqual(
- find("#modal-alert").text(),
+ query("#modal-alert").innerText,
"error isn't a valid email address."
);
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/fast-edit-test.js b/app/assets/javascripts/discourse/tests/acceptance/fast-edit-test.js
index 15ef006f361..3d7b05b8874 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/fast-edit-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/fast-edit-test.js
@@ -4,7 +4,7 @@ import {
queryAll,
selectText,
} from "discourse/tests/helpers/qunit-helpers";
-import { fillIn, triggerKeyEvent, visit } from "@ember/test-helpers";
+import { click, fillIn, triggerKeyEvent, visit } from "@ember/test-helpers";
import { test } from "qunit";
acceptance("Fast Edit", function (needs) {
diff --git a/app/assets/javascripts/discourse/tests/acceptance/flag-post-test.js b/app/assets/javascripts/discourse/tests/acceptance/flag-post-test.js
index 5fc5a754b8b..575685e95e1 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/flag-post-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/flag-post-test.js
@@ -4,7 +4,7 @@ import {
exists,
query,
} from "discourse/tests/helpers/qunit-helpers";
-import { click, visit } from "@ember/test-helpers";
+import { click, fillIn, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { skip, test } from "qunit";
import userFixtures from "discourse/tests/fixtures/user-fixtures";
diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-manage-interaction-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-manage-interaction-test.js
index f16080b70c2..558a99b4b46 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/group-manage-interaction-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/group-manage-interaction-test.js
@@ -1,6 +1,7 @@
import {
acceptance,
count,
+ exists,
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-test.js
index d1f436f6b24..fb60cfaaecf 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/group-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/group-test.js
@@ -5,7 +5,7 @@ import {
query,
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
-import { click, visit } from "@ember/test-helpers";
+import { click, fillIn, visit } from "@ember/test-helpers";
import I18n from "I18n";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { test } from "qunit";
diff --git a/app/assets/javascripts/discourse/tests/acceptance/keyboard-shortcuts-test.js b/app/assets/javascripts/discourse/tests/acceptance/keyboard-shortcuts-test.js
index 4ab616174cc..2dd67770347 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/keyboard-shortcuts-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/keyboard-shortcuts-test.js
@@ -1,4 +1,4 @@
-import { currentURL, triggerKeyEvent, visit } from "@ember/test-helpers";
+import { click, currentURL, triggerKeyEvent, visit } from "@ember/test-helpers";
import { cloneJSON } from "discourse-common/lib/object";
import I18n from "I18n";
import {
diff --git a/app/assets/javascripts/discourse/tests/acceptance/notifications-test.js b/app/assets/javascripts/discourse/tests/acceptance/notifications-test.js
index c1571cdcf8c..34160f56668 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/notifications-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/notifications-test.js
@@ -1,4 +1,4 @@
-import { visit } from "@ember/test-helpers";
+import { click, visit } from "@ember/test-helpers";
import {
acceptance,
count,
diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-footer-button-api-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-footer-button-api-test.js
index a3702c54f63..ca9313f92d3 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/topic-footer-button-api-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-footer-button-api-test.js
@@ -1,5 +1,5 @@
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
-import { visit } from "@ember/test-helpers";
+import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { withPluginApi } from "discourse/lib/plugin-api";
diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js
index 93b7881feb8..6c9c7bb9c25 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js
@@ -6,7 +6,7 @@ import {
selectText,
} from "discourse/tests/helpers/qunit-helpers";
import I18n from "I18n";
-import { triggerKeyEvent, visit } from "@ember/test-helpers";
+import { click, triggerKeyEvent, visit } from "@ember/test-helpers";
import { test } from "qunit";
// This tests are flaky on Firefox. Fails with `calling set on destroyed object`
diff --git a/app/assets/javascripts/discourse/tests/helpers/component-test.js b/app/assets/javascripts/discourse/tests/helpers/component-test.js
index e44e71b8587..30b1adc67eb 100644
--- a/app/assets/javascripts/discourse/tests/helpers/component-test.js
+++ b/app/assets/javascripts/discourse/tests/helpers/component-test.js
@@ -9,7 +9,7 @@ import User from "discourse/models/user";
import { autoLoadModules } from "discourse/initializers/auto-load-modules";
import createStore from "discourse/tests/helpers/create-store";
import { currentSettings } from "discourse/tests/helpers/site-settings";
-import { test } from "qunit";
+import QUnit, { test } from "qunit";
const LEGACY_ENV = !EmberSetupRenderingTest;
diff --git a/app/assets/javascripts/discourse/tests/integration/components/bookmark-test.js b/app/assets/javascripts/discourse/tests/integration/components/bookmark-test.js
index 4006849227e..0226bef7c43 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/bookmark-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/bookmark-test.js
@@ -10,6 +10,7 @@ import {
} from "discourse/tests/helpers/qunit-helpers";
import I18n from "I18n";
import hbs from "htmlbars-inline-precompile";
+import { click } from "@ember/test-helpers";
discourseModule("Integration | Component | bookmark", function (hooks) {
setupRenderingTest(hooks);
diff --git a/app/assets/javascripts/discourse/tests/integration/components/hidden-details-test.js b/app/assets/javascripts/discourse/tests/integration/components/hidden-details-test.js
index 4c44c36698d..2214aa74020 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/hidden-details-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/hidden-details-test.js
@@ -8,6 +8,7 @@ import {
} from "discourse/tests/helpers/qunit-helpers";
import hbs from "htmlbars-inline-precompile";
import I18n from "I18n";
+import { click } from "@ember/test-helpers";
discourseModule("Integration | Component | hidden-details", function (hooks) {
setupRenderingTest(hooks);
diff --git a/app/assets/javascripts/discourse/tests/integration/components/invite-panel-test.js b/app/assets/javascripts/discourse/tests/integration/components/invite-panel-test.js
index 177d0fdc49c..e9bee7f8fc4 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/invite-panel-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/invite-panel-test.js
@@ -5,7 +5,11 @@ import componentTest, {
setupRenderingTest,
} from "discourse/tests/helpers/component-test";
import pretender from "discourse/tests/helpers/create-pretender";
-import { discourseModule, exists } from "discourse/tests/helpers/qunit-helpers";
+import {
+ discourseModule,
+ exists,
+ query,
+} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import hbs from "htmlbars-inline-precompile";
@@ -45,7 +49,7 @@ discourseModule("Integration | Component | invite-panel", function (hooks) {
assert.ok(!exists(".send-invite:disabled"));
await click(".generate-invite-link");
assert.strictEqual(
- find(".invite-link-input")[0].value,
+ query(".invite-link-input").value,
"http://example.com/invites/92c297e886a0ca03089a109ccd6be155"
);
},
diff --git a/app/assets/javascripts/discourse/tests/integration/components/pick-files-button-tests.js b/app/assets/javascripts/discourse/tests/integration/components/pick-files-button-tests.js
index b00d0936dba..db622c99b43 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/pick-files-button-tests.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/pick-files-button-tests.js
@@ -5,6 +5,7 @@ import { discourseModule } from "discourse/tests/helpers/qunit-helpers";
import hbs from "htmlbars-inline-precompile";
import { triggerEvent } from "@ember/test-helpers";
import sinon from "sinon";
+import bootbox from "bootbox";
function createBlob(mimeType, extension) {
const blob = new Blob(["content"], {
diff --git a/app/assets/javascripts/discourse/tests/integration/components/site-header-test.js b/app/assets/javascripts/discourse/tests/integration/components/site-header-test.js
index 1556c47ccda..8f4ba6d2c9d 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/site-header-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/site-header-test.js
@@ -8,6 +8,7 @@ import {
} from "discourse/tests/helpers/qunit-helpers";
import pretender from "discourse/tests/helpers/create-pretender";
import hbs from "htmlbars-inline-precompile";
+import { click } from "@ember/test-helpers";
discourseModule("Integration | Component | site-header", function (hooks) {
setupRenderingTest(hooks);
diff --git a/app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js b/app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js
index 34384a54a29..840eb6fdb29 100644
--- a/app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js
+++ b/app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js
@@ -3,7 +3,7 @@ import {
applyCachedInlineOnebox,
deleteCachedInlineOnebox,
} from "pretty-text/inline-oneboxer";
-import { module, skip, test } from "qunit";
+import QUnit, { module, skip, test } from "qunit";
import Post from "discourse/models/post";
import { buildQuote } from "discourse/lib/quote";
import { deepMerge } from "discourse-common/lib/object";
diff --git a/app/assets/javascripts/start-discourse.js b/app/assets/javascripts/start-discourse.js
index 2791d2ce132..41b452a88dd 100644
--- a/app/assets/javascripts/start-discourse.js
+++ b/app/assets/javascripts/start-discourse.js
@@ -1,4 +1,5 @@
// discourse-skip-module
(function () {
+ // eslint-disable-next-line no-undef
Discourse.start();
})();
diff --git a/app/assets/javascripts/wizard/test/acceptance/wizard-test.js b/app/assets/javascripts/wizard/test/acceptance/wizard-test.js
index fabec00d36f..ea550cf2708 100644
--- a/app/assets/javascripts/wizard/test/acceptance/wizard-test.js
+++ b/app/assets/javascripts/wizard/test/acceptance/wizard-test.js
@@ -1,4 +1,4 @@
-import { currentRouteName, visit } from "@ember/test-helpers";
+import { click, currentRouteName, fillIn, visit } from "@ember/test-helpers";
import { module, test } from "qunit";
import { run } from "@ember/runloop";
import startApp from "wizard/test/helpers/start-app";
diff --git a/app/assets/javascripts/wizard/test/components/invite-list-test.js b/app/assets/javascripts/wizard/test/components/invite-list-test.js
index 572b97ec48a..2acfe5071c0 100644
--- a/app/assets/javascripts/wizard/test/components/invite-list-test.js
+++ b/app/assets/javascripts/wizard/test/components/invite-list-test.js
@@ -1,5 +1,6 @@
import { componentTest } from "wizard/test/helpers/component-test";
import { moduleForComponent } from "ember-qunit";
+import { click, fillIn } from "@ember/test-helpers";
moduleForComponent("invite-list", { integration: true });