mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 12:24:37 +08:00
0a5f548635
As part of this move, we are also renaming `discourse-chat` to `chat`.
35 lines
957 B
JavaScript
35 lines
957 B
JavaScript
import componentTest, {
|
|
setupRenderingTest,
|
|
} from "discourse/tests/helpers/component-test";
|
|
import hbs from "htmlbars-inline-precompile";
|
|
import { exists, query } from "discourse/tests/helpers/qunit-helpers";
|
|
import { module } from "qunit";
|
|
|
|
module("Discourse Chat | Component | chat-message-avatar", function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
componentTest("chat_webhook_event", {
|
|
template: hbs`{{chat-message-avatar message=message}}`,
|
|
|
|
beforeEach() {
|
|
this.set("message", { chat_webhook_event: { emoji: ":heart:" } });
|
|
},
|
|
|
|
async test(assert) {
|
|
assert.equal(query(".chat-emoji-avatar .emoji").title, "heart");
|
|
},
|
|
});
|
|
|
|
componentTest("user", {
|
|
template: hbs`{{chat-message-avatar message=message}}`,
|
|
|
|
beforeEach() {
|
|
this.set("message", { user: { username: "discobot" } });
|
|
},
|
|
|
|
async test(assert) {
|
|
assert.ok(exists('.chat-user-avatar [data-user-card="discobot"]'));
|
|
},
|
|
});
|
|
});
|