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:
Steve Howell 2022-03-17 15:14:52 +00:00 committed by Steve Howell
parent 599a70d6f4
commit bffd73fe44
1 changed files with 10 additions and 0 deletions

View File

@ -93,6 +93,16 @@ test("basic_get_suggestions", ({override_rewire}) => {
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", () => {
const query = "stream:Denmark topic:Hamlet shakespeare";