mirror of
https://github.com/discourse/discourse.git
synced 2024-12-11 22:34:04 +08:00
24 lines
878 B
JavaScript
24 lines
878 B
JavaScript
import { getOwner } from "@ember/owner";
|
|
import { render } from "@ember/test-helpers";
|
|
import hbs from "htmlbars-inline-precompile";
|
|
import { module, test } from "qunit";
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
|
|
|
|
module("Discourse Chat | 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(hbs`
|
|
<Chat::Thread::Header @thread={{this.thread}} @channel={{this.thread.channel}} />
|
|
`);
|
|
|
|
assert
|
|
.dom(".c-navbar__title")
|
|
.includesHtml("<style>body { background: red;}</style>");
|
|
});
|
|
});
|