mirror of
https://github.com/discourse/discourse.git
synced 2024-12-14 19:13:40 +08:00
038e5deb2a
* `@ember/owner` instead of `@ember/application` * `discourse-i18n` instead of `I18n` * `{ service } from "@ember/service"` instead of `inject as service`
27 lines
976 B
JavaScript
27 lines
976 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 { query } from "discourse/tests/helpers/qunit-helpers";
|
|
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.ok(
|
|
query(".c-navbar__title")
|
|
.innerHTML.trim()
|
|
.includes("<style>body { background: red;}</style>")
|
|
);
|
|
});
|
|
});
|