minor: Add test for mentions using silent syntax inside quotes.

This commit is contained in:
Rohitt Vashishtha 2019-01-22 19:17:10 +05:30 committed by Tim Abbott
parent 8aee6a1dd7
commit 0451c42e5c
1 changed files with 7 additions and 1 deletions

View File

@ -1016,7 +1016,7 @@ class BugdownTest(ZulipTestCase):
'</p>' % (hamlet.id, othello.id, hamlet.id, cordelia.id)) '</p>' % (hamlet.id, othello.id, hamlet.id, cordelia.id))
self.assertEqual(msg.mentions_user_ids, set([hamlet.id, cordelia.id])) self.assertEqual(msg.mentions_user_ids, set([hamlet.id, cordelia.id]))
# Both fenced quote and > quote should be identical # Both fenced quote and > quote should be identical for both silent and regular syntax.
expected = ('<blockquote>\n<p>' expected = ('<blockquote>\n<p>'
'<span class="user-mention silent" data-user-id="%s">@King Hamlet</span>' '<span class="user-mention silent" data-user-id="%s">@King Hamlet</span>'
'</p>\n</blockquote>' % (hamlet.id)) '</p>\n</blockquote>' % (hamlet.id))
@ -1026,6 +1026,12 @@ class BugdownTest(ZulipTestCase):
content = "> @**King Hamlet**" content = "> @**King Hamlet**"
self.assertEqual(render_markdown(msg, content), expected) self.assertEqual(render_markdown(msg, content), expected)
self.assertEqual(msg.mentions_user_ids, set()) self.assertEqual(msg.mentions_user_ids, set())
content = "```quote\n_@**King Hamlet**\n```"
self.assertEqual(render_markdown(msg, content), expected)
self.assertEqual(msg.mentions_user_ids, set())
content = "> _@**King Hamlet**"
self.assertEqual(render_markdown(msg, content), expected)
self.assertEqual(msg.mentions_user_ids, set())
def test_mention_duplicate_full_name(self) -> None: def test_mention_duplicate_full_name(self) -> None:
realm = get_realm('zulip') realm = get_realm('zulip')