discourse/plugins/chat/test/javascripts/components/chat-thread-header-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

25 lines
918 B
Text
Vendored

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 Header from "discourse/plugins/chat/discourse/components/chat/thread/header";
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
module("Component | chat-thread-header", function (hooks) {
setupRenderingTest(hooks);
test("it safely renders title", async function (assert) {
const title = "<style>body { background: red;}</style>";
this.thread = new ChatFabricators(getOwner(this)).thread({ title });
await render(
<template>
<Header @thread={{this.thread}} @channel={{this.thread.channel}} />
</template>
);
assert
.dom(".c-navbar__title")
.includesHtml("&lt;style&gt;body { background: red;}&lt;/style&gt;");
});
});