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