2024-04-09 03:00:09 +08:00
|
|
|
import { getOwner } from "@ember/application";
|
2024-01-25 22:30:21 +08:00
|
|
|
import { render } from "@ember/test-helpers";
|
|
|
|
import { module, test } from "qunit";
|
|
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
|
|
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
|
2024-04-09 03:00:09 +08:00
|
|
|
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
|
2024-01-25 22:30:21 +08:00
|
|
|
|
|
|
|
module("Discourse Chat | Component | <ChannelTitle />", function (hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
|
|
|
|
|
|
|
test("icon", async function (assert) {
|
2024-04-09 03:00:09 +08:00
|
|
|
const channel = new ChatFabricators(getOwner(this)).channel();
|
2024-01-25 22:30:21 +08:00
|
|
|
|
|
|
|
await render(<template><ChannelTitle @channel={{channel}} /></template>);
|
|
|
|
|
|
|
|
assert.dom(".chat-channel-icon").exists();
|
|
|
|
});
|
|
|
|
|
|
|
|
test("label", async function (assert) {
|
2024-04-09 03:00:09 +08:00
|
|
|
const channel = new ChatFabricators(getOwner(this)).channel();
|
2024-01-25 22:30:21 +08:00
|
|
|
|
|
|
|
await render(<template><ChannelTitle @channel={{channel}} /></template>);
|
|
|
|
|
|
|
|
assert.dom(".chat-channel-name").exists();
|
|
|
|
});
|
|
|
|
});
|