mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:12:45 +08:00
DEV: Fix linting issues in core plugins (#14916)
This commit is contained in:
parent
f414d5eace
commit
906a71a607
|
@ -7,6 +7,7 @@ import I18n from "I18n";
|
|||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import { test } from "qunit";
|
||||
import { click, fillIn, visit } from "@ember/test-helpers";
|
||||
|
||||
acceptance("Details Button", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -12,6 +12,7 @@ import loadScript from "discourse/lib/load-script";
|
|||
import { notEmpty } from "@ember/object/computed";
|
||||
import { propertyNotEqual } from "discourse/lib/computed";
|
||||
import { schedule } from "@ember/runloop";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
|
||||
export default Component.extend({
|
||||
timeFormat: "HH:mm:ss",
|
||||
|
@ -435,7 +436,7 @@ export default Component.extend({
|
|||
},
|
||||
|
||||
_closeModal() {
|
||||
const composer = Discourse.__container__.lookup("controller:composer");
|
||||
const composer = getOwner(this).lookup("controller:composer");
|
||||
composer.send("closeModal");
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, fillIn, visit } from "@ember/test-helpers";
|
||||
|
||||
acceptance("Local Dates - composer", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import I18n from "I18n";
|
||||
import LocalDateBuilder from "./local-date-builder";
|
||||
import sinon from "sinon";
|
||||
import { module, test } from "qunit";
|
||||
import QUnit, { module, test } from "qunit";
|
||||
|
||||
const UTC = "Etc/UTC";
|
||||
const SYDNEY = "Australia/Sydney";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {
|
||||
acceptance,
|
||||
count,
|
||||
exists,
|
||||
queryAll,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { click, currentURL, fillIn, visit } from "@ember/test-helpers";
|
||||
|
|
|
@ -8,6 +8,7 @@ import discourseComputed from "discourse-common/utils/decorators";
|
|||
import { htmlSafe } from "@ember/template";
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import bootbox from "bootbox";
|
||||
|
||||
export default Controller.extend(ModalFunctionality, {
|
||||
model: null,
|
||||
|
|
|
@ -13,6 +13,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
|
|||
import { relativeAge } from "discourse/lib/formatter";
|
||||
import round from "discourse/lib/round";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import bootbox from "bootbox";
|
||||
|
||||
const FETCH_VOTERS_COUNT = 25;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
import { test } from "qunit";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { click, visit } from "@ember/test-helpers";
|
||||
|
||||
acceptance("Poll breakdown", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
import { test } from "qunit";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { click, visit } from "@ember/test-helpers";
|
||||
|
||||
acceptance("Poll in a post reply history", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { acceptance, count } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
import { test } from "qunit";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { click, visit } from "@ember/test-helpers";
|
||||
|
||||
acceptance("Poll quote", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { click, visit } from "@ember/test-helpers";
|
||||
|
||||
acceptance("Poll results", function (needs) {
|
||||
needs.user();
|
||||
|
@ -568,11 +568,11 @@ acceptance("Poll results", function (needs) {
|
|||
await visit("/t/-/load-more-poll-voters");
|
||||
|
||||
assert.strictEqual(
|
||||
find(".poll-container .results li:nth-child(1) .poll-voters li").length,
|
||||
count(".poll-container .results li:nth-child(1) .poll-voters li"),
|
||||
1
|
||||
);
|
||||
assert.strictEqual(
|
||||
find(".poll-container .results li:nth-child(2) .poll-voters li").length,
|
||||
count(".poll-container .results li:nth-child(2) .poll-voters li"),
|
||||
0
|
||||
);
|
||||
|
||||
|
@ -627,11 +627,11 @@ acceptance("Poll results", function (needs) {
|
|||
await visit("/t/-/load-more-poll-voters");
|
||||
|
||||
assert.strictEqual(
|
||||
find(".poll-container .results li:nth-child(1) .poll-voters li").length,
|
||||
count(".poll-container .results li:nth-child(1) .poll-voters li"),
|
||||
1
|
||||
);
|
||||
assert.strictEqual(
|
||||
find(".poll-container .results li:nth-child(2) .poll-voters li").length,
|
||||
count(".poll-container .results li:nth-child(2) .poll-voters li"),
|
||||
1
|
||||
);
|
||||
|
||||
|
@ -639,11 +639,11 @@ acceptance("Poll results", function (needs) {
|
|||
await visit("/t/-/load-more-poll-voters");
|
||||
|
||||
assert.strictEqual(
|
||||
find(".poll-container .results li:nth-child(1) .poll-voters li").length,
|
||||
count(".poll-container .results li:nth-child(1) .poll-voters li"),
|
||||
2
|
||||
);
|
||||
assert.strictEqual(
|
||||
find(".poll-container .results li:nth-child(2) .poll-voters li").length,
|
||||
count(".poll-container .results li:nth-child(2) .poll-voters li"),
|
||||
0
|
||||
);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
import { test } from "qunit";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { click, visit } from "@ember/test-helpers";
|
||||
|
||||
acceptance("Rendering polls with bar charts - desktop", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
import { test } from "qunit";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { click, visit } from "@ember/test-helpers";
|
||||
|
||||
acceptance("Rendering polls with bar charts - mobile", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
@ -11,6 +11,7 @@ import EmberObject from "@ember/object";
|
|||
import I18n from "I18n";
|
||||
import pretender from "discourse/tests/helpers/create-pretender";
|
||||
import hbs from "htmlbars-inline-precompile";
|
||||
import { click } from "@ember/test-helpers";
|
||||
|
||||
let requests = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user