mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
UX: Update Chat Group Name and Placeholder (#28703)
* UX: Update Chat Group Name and Placeholder * update tests * fix failing tests * better checking of system user when setting dm title
This commit is contained in:
@ -4,6 +4,7 @@ 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";
|
||||
|
||||
module(
|
||||
@ -30,13 +31,13 @@ module(
|
||||
);
|
||||
});
|
||||
|
||||
test("direct message to multiple folks shows their names", async function (assert) {
|
||||
test("direct message to multiple folks shows their names when not a group", async function (assert) {
|
||||
pretender.get("/chat/emojis.json", () => [200, [], {}]);
|
||||
|
||||
this.channel = ChatChannel.create({
|
||||
chatable_type: "DirectMessage",
|
||||
chatable: {
|
||||
group: true,
|
||||
group: false,
|
||||
users: [
|
||||
{ name: "Tomtom" },
|
||||
{ name: "Steaky" },
|
||||
@ -53,6 +54,30 @@ module(
|
||||
);
|
||||
});
|
||||
|
||||
test("direct message to group shows Chat in group", async function (assert) {
|
||||
pretender.get("/chat/emojis.json", () => [200, [], {}]);
|
||||
|
||||
this.channel = ChatChannel.create({
|
||||
chatable_type: "DirectMessage",
|
||||
title: "Meetup Chat",
|
||||
chatable: {
|
||||
group: true,
|
||||
users: [
|
||||
{ username: "user1" },
|
||||
{ username: "user2" },
|
||||
{ username: "user3" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
await render(hbs`<Chat::Composer::Channel @channel={{this.channel}} />`);
|
||||
|
||||
assert.strictEqual(
|
||||
query(".chat-composer__input").placeholder,
|
||||
I18n.t("chat.placeholder_group")
|
||||
);
|
||||
});
|
||||
|
||||
test("message to channel shows send message to channel name", async function (assert) {
|
||||
pretender.get("/chat/emojis.json", () => [200, [], {}]);
|
||||
|
||||
|
Reference in New Issue
Block a user