Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

node tests: Test email mentions.

Steve Howell64e56f71878f
diff --git a/frontend_tests/node_tests/rendered_markdown.js b/frontend_tests/node_tests/rendered_markdown.js
index ddcd19522b8..57f5f761f93 100644
--- a/frontend_tests/node_tests/rendered_markdown.js
+++ b/frontend_tests/node_tests/rendered_markdown.js
@@ -37,9 +37,9 @@ const iago = {
};
const cordelia = {
- email: "[email protected]",
+ email: "[email protected]",
user_id: 31,
- full_name: "Cordelia",
+ full_name: "Cordelia Lear",
};
people.init();
people.add_active_user(iago);
@@ -138,6 +138,19 @@ run_test("user-mention (wildcard)", () => {
assert($mention.hasClass("user-mention-me"));
});
+run_test("user-mention (email)", () => {
+ // Setup
+ const $content = get_content_element();
+ const $mention = $.create("mention");
+ $mention.attr("data-user-email", cordelia.email);
+ $mention.set_find_results(".highlight", false);
+ $content.set_find_results(".user-mention", $array([$mention]));
+
+ rm.update_elements($content);
+ assert(!$mention.hasClass("user-mention-me"));
+ assert.equal($mention.text(), "@Cordelia Lear");
+});
+
run_test("user-group-mention", () => {
// Setup
const $content = get_content_element();