REFACTOR: Replace global find with queryAll

In newer Embers jQuery is removed. There is a `find` but it only returns
one element and not a jQuery selector. This patch migrates our code to a
new helper `queryAll` which allows us to remove the global.
This commit is contained in:
Robin Ward
2020-10-28 16:36:01 -04:00
parent c750a02f05
commit 435a9913a4
135 changed files with 1343 additions and 1025 deletions

View File

@ -1,4 +1,4 @@
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
acceptance("Local Dates - composer", function (needs) {
needs.user();
@ -6,9 +6,9 @@ acceptance("Local Dates - composer", function (needs) {
test("composer bbcode", async (assert) => {
const getAttr = (attr) => {
return find(".d-editor-preview .discourse-local-date.cooked-date").attr(
`data-${attr}`
);
return queryAll(
".d-editor-preview .discourse-local-date.cooked-date"
).attr(`data-${attr}`);
};
await visit("/");