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:
Joffrey JAFFEUX
2024-09-17 20:52:34 +02:00
committed by GitHub
parent c93235f4f5
commit 2aca41914a
6 changed files with 28 additions and 10 deletions

View File

@ -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(),