DEV: Reduce jQuery usage in acceptance tests (#17406)

This commit is contained in:
Jarek Radosz
2022-07-10 10:52:02 +02:00
committed by GitHub
parent 06ae9229e8
commit 0f01cc7df2
35 changed files with 419 additions and 425 deletions

View File

@ -2,7 +2,7 @@ import {
acceptance,
count,
exists,
queryAll,
query,
} from "discourse/tests/helpers/qunit-helpers";
import { click, currentURL, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
@ -116,8 +116,8 @@ acceptance("Discourse Presence Plugin", function (needs) {
await click(".topic-post:nth-of-type(1) button.edit");
assert.strictEqual(
queryAll(".d-editor-input").val(),
queryAll(".topic-post:nth-of-type(1) .cooked > p").text(),
query(".d-editor-input").value,
query(".topic-post:nth-of-type(1) .cooked > p").innerText,
"composer has contents of post to be edited"
);
@ -162,7 +162,7 @@ acceptance("Discourse Presence Plugin", function (needs) {
await joinChannel("/discourse-presence/reply/280", {
id: 123,
avatar_template: "/a/b/c.jpg",
username: "myusername",
username: "my-username",
});
assert.strictEqual(count(avatarSelector), 1, "avatar displayed");
@ -170,7 +170,7 @@ acceptance("Discourse Presence Plugin", function (needs) {
await joinChannel("/discourse-presence/whisper/280", {
id: 124,
avatar_template: "/a/b/c.jpg",
username: "myusername2",
username: "my-username2",
});
assert.strictEqual(count(avatarSelector), 2, "whisper avatar displayed");
@ -199,7 +199,7 @@ acceptance("Discourse Presence Plugin", function (needs) {
await joinChannel("/discourse-presence/reply/280", {
id: 123,
avatar_template: "/a/b/c.jpg",
username: "myusername",
username: "my-username",
});
assert.strictEqual(count(avatarSelector), 1, "avatar displayed");
@ -207,7 +207,7 @@ acceptance("Discourse Presence Plugin", function (needs) {
await joinChannel("/discourse-presence/whisper/280", {
id: 124,
avatar_template: "/a/b/c.jpg",
username: "myusername2",
username: "my-username2",
});
assert.strictEqual(count(avatarSelector), 2, "whisper avatar displayed");