node tests: Get 100% coverage on rendered_markdown.

This commit is contained in:
Steve Howell
2021-05-25 20:29:33 +00:00
committed by Tim Abbott
parent 83e6c66355
commit 2dd7a8864c
2 changed files with 19 additions and 1 deletions

View File

@@ -148,6 +148,15 @@ run_test("user-mention (email)", () => {
assert.equal($mention.text(), "@Cordelia Lear"); 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", () => { run_test("user-group-mention", () => {
// Setup // Setup
const $content = get_content_element(); const $content = get_content_element();
@@ -183,6 +192,16 @@ run_test("user-group-mention (error)", () => {
assert(!$group.hasClass("user-mention-me")); 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", () => { run_test("stream-links", () => {
// Setup // Setup
const $content = get_content_element(); const $content = get_content_element();

View File

@@ -110,7 +110,6 @@ EXEMPT_FILES = {
"static/js/recent_topics.js", "static/js/recent_topics.js",
"static/js/reload.js", "static/js/reload.js",
"static/js/reminder.js", "static/js/reminder.js",
"static/js/rendered_markdown.js",
"static/js/resize.js", "static/js/resize.js",
"static/js/rows.js", "static/js/rows.js",
"static/js/scroll_bar.js", "static/js/scroll_bar.js",