DEV: Replace remaining uses of query helper (#30019)

This commit is contained in:
Jarek Radosz
2025-01-22 00:25:03 +01:00
committed by GitHub
parent fbb90aac1b
commit e98644fbc6
55 changed files with 671 additions and 778 deletions

View File

@ -3,7 +3,6 @@ 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 } from "discourse/tests/helpers/qunit-helpers";
import { i18n } from "discourse-i18n";
import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";
@ -25,10 +24,9 @@ module(
await render(hbs`<Chat::Composer::Channel @channel={{this.channel}} />`);
assert.strictEqual(
query(".chat-composer__input").placeholder,
"Jot something down"
);
assert
.dom(".chat-composer__input")
.hasAttribute("placeholder", "Jot something down");
});
test("direct message to multiple folks shows their names when not a group", async function (assert) {
@ -48,10 +46,9 @@ module(
await render(hbs`<Chat::Composer::Channel @channel={{this.channel}} />`);
assert.strictEqual(
query(".chat-composer__input").placeholder,
"Chat with Tomtom, Steaky, @zorro"
);
assert
.dom(".chat-composer__input")
.hasAttribute("placeholder", "Chat with Tomtom, Steaky, @zorro");
});
test("direct message to group shows Chat in group", async function (assert) {
@ -72,10 +69,9 @@ module(
await render(hbs`<Chat::Composer::Channel @channel={{this.channel}} />`);
assert.strictEqual(
query(".chat-composer__input").placeholder,
i18n("chat.placeholder_group")
);
assert
.dom(".chat-composer__input")
.hasAttribute("placeholder", i18n("chat.placeholder_group"));
});
test("message to channel shows send message to channel name", async function (assert) {
@ -88,10 +84,9 @@ module(
await render(hbs`<Chat::Composer::Channel @channel={{this.channel}} />`);
assert.strictEqual(
query(".chat-composer__input").placeholder,
"Chat in #just-cats"
);
assert
.dom(".chat-composer__input")
.hasAttribute("placeholder", "Chat in #just-cats");
});
}
);