discourse/plugins/chat/test/javascripts/components/chat-thread-heading-test.gjs
Jarek Radosz 893fcf714b
DEV: Remove plugin names from test titles (#39418)
Those are now automatically included in testem's output.
2026-04-21 19:19:52 +02:00

30 lines
1.1 KiB
Text

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("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();
});
});