mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
node tests: Add spectator test for search suggestions.
This is a prep commit to help us soon remove 44 months worth of bit-rotted code.
This commit is contained in:
committed by
Steve Howell
parent
599a70d6f4
commit
bffd73fe44
@@ -93,6 +93,16 @@ test("basic_get_suggestions", ({override_rewire}) => {
|
|||||||
assert.deepEqual(suggestions.strings, expected);
|
assert.deepEqual(suggestions.strings, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("basic_get_suggestions_for_spectator", ({override_rewire}) => {
|
||||||
|
override_rewire(stream_data, "subscribed_streams", () => []);
|
||||||
|
page_params.is_spectator = true;
|
||||||
|
|
||||||
|
const query = "";
|
||||||
|
const suggestions = get_suggestions("", query);
|
||||||
|
assert.deepEqual(suggestions.strings, ["", "has:link", "has:image", "has:attachment"]);
|
||||||
|
page_params.is_spectator = false;
|
||||||
|
});
|
||||||
|
|
||||||
test("subset_suggestions", () => {
|
test("subset_suggestions", () => {
|
||||||
const query = "stream:Denmark topic:Hamlet shakespeare";
|
const query = "stream:Denmark topic:Hamlet shakespeare";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user