mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
DEV: only supports headings in messages for bots (#29585)
The markdown it rule "heading" will only be used when the message is done by a bot, which means an id < 0. This commit also adds a is-bot css class on messages made by a bot, for finer control. --------- Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
This commit is contained in:
@ -2,6 +2,7 @@ import { getOwner } from "@ember/owner";
|
||||
import { clearRender, render } from "@ember/test-helpers";
|
||||
import hbs from "htmlbars-inline-precompile";
|
||||
import { module, test } from "qunit";
|
||||
import CoreFabricators from "discourse/lib/fabricators";
|
||||
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
||||
import { exists, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
|
||||
@ -47,7 +48,18 @@ module("Discourse Chat | Component | chat-message", function (hooks) {
|
||||
);
|
||||
});
|
||||
|
||||
test("message with mark html tag", async function (assert) {
|
||||
test("Message by a bot", async function (assert) {
|
||||
this.message = new ChatFabricators(getOwner(this)).message({
|
||||
message: "what <mark>test</mark>",
|
||||
user: new CoreFabricators(getOwner(this)).user({ id: -10 }),
|
||||
});
|
||||
await this.message.cook();
|
||||
await render(template);
|
||||
|
||||
assert.dom(".chat-message-container.is-bot").exists("has the bot class");
|
||||
});
|
||||
|
||||
test("Message with mark html tag", async function (assert) {
|
||||
this.message = new ChatFabricators(getOwner(this)).message({
|
||||
message: "what <mark>test</mark>",
|
||||
});
|
||||
|
Reference in New Issue
Block a user