mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
FEATURE: supports mark tag in chat messages (#28949)
This brings feature parity with posts where you can use this tag.
This commit is contained in:
@ -3,7 +3,7 @@ import { clearRender, 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 { exists } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { exists, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
|
||||
|
||||
module("Discourse Chat | Component | chat-message", function (hooks) {
|
||||
@ -47,6 +47,20 @@ module("Discourse Chat | Component | chat-message", function (hooks) {
|
||||
);
|
||||
});
|
||||
|
||||
test("message with mark html tag", async function (assert) {
|
||||
this.message = new ChatFabricators(getOwner(this)).message({
|
||||
message: "what <mark>test</mark>",
|
||||
});
|
||||
await this.message.cook();
|
||||
await render(template);
|
||||
|
||||
assert.true(
|
||||
query(".chat-message-text")
|
||||
.innerHTML.trim()
|
||||
.includes("<p>what <mark>test</mark></p>")
|
||||
);
|
||||
});
|
||||
|
||||
test("Message with reply", async function (assert) {
|
||||
this.message = new ChatFabricators(getOwner(this)).message({
|
||||
inReplyTo: new ChatFabricators(getOwner(this)).message(),
|
||||
|
Reference in New Issue
Block a user