node_tests: Update alert words tests to handle a corner case.

This corner case was reported in #17320, basically, the
issue was when two or more alert words were used
consecutively with a single space between them, it didn't
detect the even number word as `alert word`.
This commit is contained in:
Riken Shah
2021-05-07 11:32:35 +00:00
committed by Tim Abbott
parent 18595fac58
commit babe24fa02

View File

@@ -48,7 +48,7 @@ const alertwordboundary_message = {
};
const multialert_message = {
sender_email: "another@zulip.com",
content: "<p>another alertthreemessage alertone and then alerttwo</p>",
content: "<p>another emoji alertone and then alerttwo</p>",
alerted: true,
};
const unsafe_word_message = {
@@ -128,7 +128,7 @@ run_test("munging", () => {
assert_transform(
multialert_message,
"<p>another alertthreemessage <span class='alert-word'>alertone</span> and then <span class='alert-word'>alerttwo</span></p>",
"<p>another <span class='alert-word'>emoji</span> <span class='alert-word'>alertone</span> and then <span class='alert-word'>alerttwo</span></p>",
);
assert_transform(