mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:41:25 +08:00
DEV: Replace remaining uses of query
helper (#30019)
This commit is contained in:
@ -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");
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user