mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
UI: simplify chat thread title (#29998)
We were using a complex logic to make it change size based on scroll position but this was imperfect and not visually pleasing. Also the title had been made a button which was causing the ellipsis to not work correctly, and I would prefer to not mix page knowledge (thread) with title component so I made this click logic directly in the chat-thread component. --------- Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
import { getOwner } from "@ember/owner";
|
||||
import { render } from "@ember/test-helpers";
|
||||
import { module, test } from "qunit";
|
||||
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
||||
import ChatThreadHeading from "discourse/plugins/chat/discourse/components/chat-thread-heading";
|
||||
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
|
||||
|
||||
module("Discourse Chat | Component | chat-thread-heading", function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test("it renders the title", async function (assert) {
|
||||
const thread = new ChatFabricators(getOwner(this)).thread({
|
||||
title: "A nice thread title",
|
||||
});
|
||||
|
||||
await render(<template><ChatThreadHeading @thread={{thread}} /></template>);
|
||||
|
||||
assert.dom(".chat-thread__heading-title").hasText("A nice thread title");
|
||||
});
|
||||
|
||||
test("it doesn’t render heading when no title", async function (assert) {
|
||||
const thread = new ChatFabricators(getOwner(this)).thread({
|
||||
title: null,
|
||||
});
|
||||
|
||||
await render(<template><ChatThreadHeading @thread={{thread}} /></template>);
|
||||
|
||||
assert.dom(".chat-thread__heading").doesNotExist();
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user