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.

search_suggestion: Fix channel info not added in tests.

Aman Agrawal41611b6e70a1
diff --git a/web/tests/search_suggestion.test.cjs b/web/tests/search_suggestion.test.cjs
index 95a1966b33e..801e6265903 100644
--- a/web/tests/search_suggestion.test.cjs
+++ b/web/tests/search_suggestion.test.cjs
@@ -348,6 +348,7 @@ test("group_suggestions", ({mock_template}) => {
// Doesn't show dms because it's invalid in combination
// with a channel. (Random channel id.)
+ stream_data.add_sub_for_tests({stream_id: 66, name: "misc", subscribed: true});
query = "channel:66 has:link dm:[email protected],Smit";
suggestions = get_suggestions(query);
expected = [];
@@ -466,7 +467,7 @@ test("has_suggestions", ({override, mock_template}) => {
expected = ["att", "has:attachment"];
assert.deepEqual(suggestions.strings, expected);
- // 66 is misc channel id.
+ stream_data.add_sub_for_tests({stream_id: 66, name: "misc", subscribed: true});
query = "channel:66 is:alerted has:lin";
suggestions = get_suggestions(query);
expected = ["channel:66 is:alerted has:link"];
@@ -567,6 +568,7 @@ test("check_is_suggestions", ({override, mock_template}) => {
expected = ["st", "channels:", "channel:", "is:starred"];
assert.deepEqual(suggestions.strings, expected);
+ stream_data.add_sub_for_tests({stream_id: 66, name: "misc", subscribed: true});
query = "channel:66 has:link is:sta";
suggestions = get_suggestions(query);
expected = ["channel:66 has:link is:starred"];
@@ -1053,6 +1055,7 @@ test("people_suggestions", ({override, mock_template}) => {
test("operator_suggestions", ({override, mock_template}) => {
mock_template("search_description.hbs", true, (_data, html) => html);
+ override(stream_topic_history_util, "get_server_history", noop);
override(narrow_state, "stream_id", () => undefined);
// Completed operator should return nothing
@@ -1071,7 +1074,7 @@ test("operator_suggestions", ({override, mock_template}) => {
expected = ["-s", "-sender:", "-channels:", "-channel:", "-sender:[email protected]"];
assert.deepEqual(suggestions.strings, expected);
- // 66 is a misc channel id.
+ stream_data.add_sub_for_tests({stream_id: 66, name: "misc", subscribed: true});
query = "channel:66 is:alerted -f";
suggestions = get_suggestions(query);
expected = [