diff --git a/web/src/search_suggestion.ts b/web/src/search_suggestion.ts index e7fdec1772..e86f4d05c2 100644 --- a/web/src/search_suggestion.ts +++ b/web/src/search_suggestion.ts @@ -1050,7 +1050,7 @@ export function get_search_result( add_current_filter = false, ): Suggestion[] { let suggestion_line: SuggestionLine; - + text_search_terms = text_search_terms.map((term) => Filter.canonicalize_term(term)); // search_terms correspond to the terms for the query in the input. // This includes the entire query entered in the searchbox. // terms correspond to the terms for the entire query entered in the searchbox. diff --git a/web/tests/search_suggestion.test.cjs b/web/tests/search_suggestion.test.cjs index dfdfce8f4a..458dd28dae 100644 --- a/web/tests/search_suggestion.test.cjs +++ b/web/tests/search_suggestion.test.cjs @@ -184,7 +184,15 @@ test("dm_suggestions", ({override, mock_template}) => { query = "is:private"; suggestions = get_suggestions(query); - expected = ["is:dm"]; + // Same search suggestions as for "is:dm" + expected = [ + "is:dm", + "dm:alice@zulip.com", + "dm:bob@zulip.com", + "dm:jeff@zulip.com", + "dm:myself@zulip.com", + "dm:ted@zulip.com", + ]; assert.deepEqual(suggestions.strings, expected); query = "dm:t";