mirror of
https://github.com/zulip/zulip.git
synced 2025-10-31 20:13:46 +00:00
topic_mentions: Fix the incorrect large @-mention notification warning.
Earlier, a 'large @-mention notification' warning that pops up for stream wildcard mentions was shown for topic wildcard mentions too, which is incorrect. This commit fixes the incorrect behavior. We no longer show the banner for @-topic mentions. We don't need a banner for @-topic mentions, as those are much less likely to be used without thinking about it and would rarely be spammy for a lot of people. Fixes #27767.
This commit is contained in:
committed by
Tim Abbott
parent
33b164f63a
commit
768be7d46d
@@ -204,46 +204,33 @@ run_test("wildcard_mentions_regexp", () => {
|
||||
"some_email@**stream**.com",
|
||||
];
|
||||
|
||||
const messages_without_topic_mentions = [
|
||||
"some text before @topic some text after",
|
||||
"@topic",
|
||||
"`@topic`",
|
||||
"some_email@topic.com",
|
||||
"`@**topic**`",
|
||||
"some_email@**topic**.com",
|
||||
];
|
||||
|
||||
let i;
|
||||
for (i = 0; i < messages_with_all_mentions.length; i += 1) {
|
||||
assert.ok(util.find_wildcard_mentions(messages_with_all_mentions[i]));
|
||||
assert.ok(util.find_stream_wildcard_mentions(messages_with_all_mentions[i]));
|
||||
}
|
||||
|
||||
for (i = 0; i < messages_with_everyone_mentions.length; i += 1) {
|
||||
assert.ok(util.find_wildcard_mentions(messages_with_everyone_mentions[i]));
|
||||
assert.ok(util.find_stream_wildcard_mentions(messages_with_everyone_mentions[i]));
|
||||
}
|
||||
|
||||
for (i = 0; i < messages_with_stream_mentions.length; i += 1) {
|
||||
assert.ok(util.find_wildcard_mentions(messages_with_stream_mentions[i]));
|
||||
assert.ok(util.find_stream_wildcard_mentions(messages_with_stream_mentions[i]));
|
||||
}
|
||||
|
||||
for (i = 0; i < messages_with_topic_mentions.length; i += 1) {
|
||||
assert.ok(util.find_wildcard_mentions(messages_with_topic_mentions[i]));
|
||||
assert.ok(!util.find_stream_wildcard_mentions(messages_with_topic_mentions[i]));
|
||||
}
|
||||
|
||||
for (i = 0; i < messages_without_all_mentions.length; i += 1) {
|
||||
assert.ok(!util.find_wildcard_mentions(messages_without_everyone_mentions[i]));
|
||||
assert.ok(!util.find_stream_wildcard_mentions(messages_without_everyone_mentions[i]));
|
||||
}
|
||||
|
||||
for (i = 0; i < messages_without_everyone_mentions.length; i += 1) {
|
||||
assert.ok(!util.find_wildcard_mentions(messages_without_everyone_mentions[i]));
|
||||
assert.ok(!util.find_stream_wildcard_mentions(messages_without_everyone_mentions[i]));
|
||||
}
|
||||
|
||||
for (i = 0; i < messages_without_stream_mentions.length; i += 1) {
|
||||
assert.ok(!util.find_wildcard_mentions(messages_without_stream_mentions[i]));
|
||||
}
|
||||
|
||||
for (i = 0; i < messages_without_topic_mentions.length; i += 1) {
|
||||
assert.ok(!util.find_wildcard_mentions(messages_without_topic_mentions[i]));
|
||||
assert.ok(!util.find_stream_wildcard_mentions(messages_without_stream_mentions[i]));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user