mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:51:14 +08:00
DEV: Clean up QUnit tests (#13328)
* DEV: Use `query` helper instead of `queryAll()[0]` * DEV: Replace `queryAll().length` w/ `exists()`/`count()` * DEV: Use `exists()` instead of `count() > 0`, `count() === 0` * DEV: Use `count()`/`exists()` instead of `find().length`
This commit is contained in:
@ -1,4 +1,8 @@
|
||||
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
|
||||
import {
|
||||
acceptance,
|
||||
query,
|
||||
queryAll,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import I18n from "I18n";
|
||||
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
@ -26,7 +30,7 @@ acceptance("Details Button", function (needs) {
|
||||
|
||||
await fillIn(".d-editor-input", "This is my title");
|
||||
|
||||
const textarea = queryAll(".d-editor-input")[0];
|
||||
const textarea = query(".d-editor-input");
|
||||
textarea.selectionStart = 0;
|
||||
textarea.selectionEnd = textarea.value.length;
|
||||
|
||||
@ -115,7 +119,7 @@ acceptance("Details Button", function (needs) {
|
||||
await click("#create-topic");
|
||||
await fillIn(".d-editor-input", multilineInput);
|
||||
|
||||
const textarea = queryAll(".d-editor-input")[0];
|
||||
const textarea = query(".d-editor-input");
|
||||
textarea.selectionStart = 0;
|
||||
textarea.selectionEnd = textarea.value.length;
|
||||
|
||||
|
Reference in New Issue
Block a user