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: Get 100% coverage on rendered_markdown.

Steve Howell2dd7a8864c07
diff --git a/frontend_tests/node_tests/rendered_markdown.js b/frontend_tests/node_tests/rendered_markdown.js
index e6dffd54370..8501648a6b5 100644
--- a/frontend_tests/node_tests/rendered_markdown.js
+++ b/frontend_tests/node_tests/rendered_markdown.js
@@ -148,6 +148,15 @@ run_test("user-mention (email)", () => {
assert.equal($mention.text(), "@Cordelia Lear");
});
+run_test("user-mention (missing)", () => {
+ const $content = get_content_element();
+ const $mention = $.create("mention");
+ $content.set_find_results(".user-mention", $array([$mention]));
+
+ rm.update_elements($content);
+ assert(!$mention.hasClass("user-mention-me"));
+});
+
run_test("user-group-mention", () => {
// Setup
const $content = get_content_element();
@@ -183,6 +192,16 @@ run_test("user-group-mention (error)", () => {
assert(!$group.hasClass("user-mention-me"));
});
+run_test("user-group-mention (missing)", () => {
+ const $content = get_content_element();
+ const $group = $.create("whatever");
+ $content.set_find_results(".user-group-mention", $array([$group]));
+
+ rm.update_elements($content);
+
+ assert(!$group.hasClass("user-mention-me"));
+});
+
run_test("stream-links", () => {
// Setup
const $content = get_content_element();
diff --git a/tools/test-js-with-node b/tools/test-js-with-node
index 7afeb94467e..426aff8667f 100755
--- a/tools/test-js-with-node
+++ b/tools/test-js-with-node
@@ -110,7 +110,6 @@ EXEMPT_FILES = {
"static/js/recent_topics.js",
"static/js/reload.js",
"static/js/reminder.js",
- "static/js/rendered_markdown.js",
"static/js/resize.js",
"static/js/rows.js",
"static/js/scroll_bar.js",