DEV: Use selectors instead of query() where possible (#29677)

This commit is contained in:
Jarek Radosz
2024-11-10 13:53:12 +01:00
committed by GitHub
parent 16a9663557
commit 78ed0bb711
7 changed files with 17 additions and 22 deletions

View File

@ -4,7 +4,7 @@ import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import pretender from "discourse/tests/helpers/create-pretender";
import { query, queryAll } from "discourse/tests/helpers/qunit-helpers";
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
import I18n from "discourse-i18n";
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
@ -57,7 +57,7 @@ module("Discourse Chat | Component | chat-notice", function (hooks) {
"Notice is present"
);
await click(query(".chat-notices__notice__clear"), "Clear the notice");
await click(".chat-notices__notice__clear");
assert.strictEqual(
queryAll(".chat-notices .chat-notices__notice").length,
@ -96,10 +96,7 @@ module("Discourse Chat | Component | chat-notice", function (hooks) {
return [200, { "Content-Type": "application/json" }, {}];
});
await click(
query(".mention-without-membership-notice__body__link"),
"Invites the user"
);
await click(".mention-without-membership-notice__body__link");
// I would love to test that the invitation sent text is present here but
// dismiss is called right away instead of waiting 3 seconds.. Not much we can