diff --git a/app/assets/javascripts/discourse/tests/acceptance/emoji-test.js b/app/assets/javascripts/discourse/tests/acceptance/emoji-test.js index cd3c47c5d60..da676ff0359 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/emoji-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/emoji-test.js @@ -16,7 +16,7 @@ acceptance("Emoji", function (needs) { await visit("/t/internationalization-localization/280"); await click("#topic-footer-buttons .btn.create"); - await simulateKeys(query(".d-editor-input"), "a :blonde_wo\t"); + await simulateKeys(".d-editor-input", "a :blonde_wo\t"); assert.strictEqual( normalizeHtml(query(".d-editor-preview").innerHTML.trim()), @@ -30,7 +30,7 @@ acceptance("Emoji", function (needs) { await visit("/t/internationalization-localization/280"); await click("#topic-footer-buttons .btn.create"); - await simulateKeys(query(".d-editor-input"), "an :arrow"); + await simulateKeys(".d-editor-input", "an :arrow"); // the 6th item in the list is the "more..." await click(".autocomplete.ac-emoji ul li:nth-of-type(6)"); @@ -49,7 +49,7 @@ acceptance("Emoji", function (needs) { await visit("/t/internationalization-localization/280"); await click("#topic-footer-buttons .btn.create"); - await fillIn(query(".d-editor-input"), "a :blonde_woman:t5:"); + await fillIn(".d-editor-input", "a :blonde_woman:t5:"); assert.strictEqual( normalizeHtml(query(".d-editor-preview").innerHTML.trim()), diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-manage-logs-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-manage-logs-test.js index 30cdfdf8924..c429be76bde 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/group-manage-logs-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/group-manage-logs-test.js @@ -1,6 +1,6 @@ import { click, visit } from "@ember/test-helpers"; import { test } from "qunit"; -import { acceptance, query } from "discourse/tests/helpers/qunit-helpers"; +import { acceptance } from "discourse/tests/helpers/qunit-helpers"; acceptance("Group logs", function (needs) { needs.user(); @@ -99,7 +99,7 @@ acceptance("Group logs", function (needs) { .dom("tr.group-manage-logs-row") .exists({ count: 2 }, "displays the right number of logs"); - await click(query(".group-manage-logs-row button")); + await click(".group-manage-logs-row button"); assert .dom("tr.group-manage-logs-row") .exists({ count: 1 }, "displays the right number of logs"); diff --git a/app/assets/javascripts/discourse/tests/acceptance/hashtag-autocomplete-test.js b/app/assets/javascripts/discourse/tests/acceptance/hashtag-autocomplete-test.js index 88c2b46b454..e3e373c6e5e 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/hashtag-autocomplete-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/hashtag-autocomplete-test.js @@ -2,7 +2,6 @@ import { click, visit } from "@ember/test-helpers"; import { test } from "qunit"; import { acceptance, - query, simulateKeys, } from "discourse/tests/helpers/qunit-helpers"; @@ -55,7 +54,7 @@ acceptance("#hashtag autocompletion in composer", function (needs) { test(":emoji: unescape in autocomplete search results", async function (assert) { await visit("/t/internationalization-localization/280"); await click("#topic-footer-buttons .btn.create"); - await simulateKeys(query(".d-editor-input"), "abc #o"); + await simulateKeys(".d-editor-input", "abc #o"); assert.dom(".hashtag-autocomplete__option").exists({ count: 3 }); assert diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-account-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-account-test.js index d2cd38af86b..c38494f55d0 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-account-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-account-test.js @@ -80,7 +80,7 @@ acceptance("User Preferences - Account", function (needs) { assert.dom(".username-preference__input").hasValue("eviltrout"); assert.dom(".username-preference__submit").isDisabled(); - await fillIn(query(".username-preference__input"), "good_trout"); + await fillIn(".username-preference__input", "good_trout"); assert.dom(".username-preference__submit").isEnabled(); await click(".username-preference__submit"); diff --git a/app/assets/javascripts/discourse/tests/integration/components/site-setting-test.js b/app/assets/javascripts/discourse/tests/integration/components/site-setting-test.js index 8450d55bfeb..3ed59c8ccf5 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/site-setting-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/site-setting-test.js @@ -35,8 +35,8 @@ module("Integration | Component | site-setting", function (hooks) { }); await render(hbs``); - await fillIn(query(".setting input"), "value"); - await click(query(".setting .d-icon-check")); + await fillIn(".setting input", "value"); + await click(".setting .d-icon-check"); assert.strictEqual(query(".validation-error h1").outerHTML, message); }); @@ -55,8 +55,8 @@ module("Integration | Component | site-setting", function (hooks) { }); await render(hbs``); - await fillIn(query(".setting input"), "value"); - await click(query(".setting .d-icon-check")); + await fillIn(".setting input", "value"); + await click(".setting .d-icon-check"); assert.dom(".validation-error h1").doesNotExist(); }); @@ -72,13 +72,13 @@ module("Integration | Component | site-setting", function (hooks) { assert.dom(".formatted-selection").hasText("jpg, jpeg, png"); - await click(query(".file-types-list__button.image")); + await click(".file-types-list__button.image"); assert .dom(".formatted-selection") .hasText("jpg, jpeg, png, gif, heic, heif, webp, avif, svg"); - await click(query(".file-types-list__button.image")); + await click(".file-types-list__button.image"); assert .dom(".formatted-selection") diff --git a/app/assets/javascripts/discourse/tests/integration/components/widgets/widget-test.js b/app/assets/javascripts/discourse/tests/integration/components/widgets/widget-test.js index 2b27307423f..4b6cc2e827f 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/widgets/widget-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/widgets/widget-test.js @@ -6,7 +6,6 @@ import { Promise } from "rsvp"; import { h } from "virtual-dom"; import { withPluginApi } from "discourse/lib/plugin-api"; import { setupRenderingTest } from "discourse/tests/helpers/component-test"; -import { query } from "discourse/tests/helpers/qunit-helpers"; import widgetHbs from "discourse/widgets/hbs-compiler"; import { createWidget } from "discourse/widgets/widget"; import I18n from "discourse-i18n"; @@ -171,7 +170,7 @@ module("Integration | Component | Widget | base", function (hooks) { assert.dom("button.test").exists("renders the button"); assert.dom("button.test").hasText("0 clicks"); - await click(query("button")); + await click("button"); assert.dom("button.test").hasText("1 clicks"); }); diff --git a/plugins/chat/test/javascripts/components/chat-notices-test.js b/plugins/chat/test/javascripts/components/chat-notices-test.js index 202cd153757..5373b44b471 100644 --- a/plugins/chat/test/javascripts/components/chat-notices-test.js +++ b/plugins/chat/test/javascripts/components/chat-notices-test.js @@ -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