mirror of
https://github.com/discourse/discourse.git
synced 2025-05-26 04:33:38 +08:00
FEATURE: site setting enable_mentions to turn on/off mentions
This commit is contained in:

committed by
Robin Ward

parent
3e4f02a180
commit
fd99e1ef56
@ -8,6 +8,7 @@ QUnit.module("lib:pretty-text");
|
||||
const rawOpts = {
|
||||
siteSettings: {
|
||||
enable_emoji: true,
|
||||
enable_mentions: true,
|
||||
emoji_set: 'emoji_one',
|
||||
highlighted_languages: 'json|ruby|javascript',
|
||||
default_code_lang: 'auto',
|
||||
@ -282,7 +283,6 @@ QUnit.test("Quotes", assert => {
|
||||
});
|
||||
|
||||
QUnit.test("Mentions", assert => {
|
||||
|
||||
const alwaysTrue = { mentionLookup: (function() { return "user"; }) };
|
||||
|
||||
assert.cookedOptions("Hello @sam", alwaysTrue,
|
||||
@ -370,6 +370,12 @@ QUnit.test("Mentions", assert => {
|
||||
"it allows mentions within HTML tags");
|
||||
});
|
||||
|
||||
QUnit.test("Mentions - disabled", assert => {
|
||||
assert.cookedOptions("@eviltrout",
|
||||
{ siteSettings : { enable_mentions: false }},
|
||||
"<p>@eviltrout</p>");
|
||||
});
|
||||
|
||||
QUnit.test("Category hashtags", assert => {
|
||||
const alwaysTrue = { categoryHashtagLookup: (function() { return ["http://test.discourse.org/category-hashtag", "category-hashtag"]; }) };
|
||||
|
||||
|
Reference in New Issue
Block a user