discourse/plugins/chat/test/javascripts/components/chat-thread-header-test.gjs
David Taylor 9322a46fa4
DEV: Remove unneeded const self = this; from qunit tests (#35632)
This was required in older versions of Ember. But now, bare template
tags can access `this.`. This commit was created by upgrading lint-configs, and then running 
`pnpm lint:js:fix && pnpm lint:prettier:fix`

Rule development: https://github.com/discourse/lint-configs/pull/154
2025-10-27 18:07:22 +00:00

25 lines
935 B
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 Header from "discourse/plugins/chat/discourse/components/chat/thread/header";
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(
<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;");
});
});