mirror of https://github.com/zulip/zulip.git
Add test_subset_suggestions() to search_suggestion.js
(imported from commit db9173ffa92ca225baf24a1103807034e4f31a7f)
This commit is contained in:
parent
98f7870150
commit
8363b7c59a
|
@ -51,6 +51,28 @@ set_global('narrow', {});
|
||||||
assert.deepEqual(suggestions.strings, expected);
|
assert.deepEqual(suggestions.strings, expected);
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
(function test_subset_suggestions() {
|
||||||
|
var query = 'stream:Denmark topic:Hamlet shakespeare';
|
||||||
|
|
||||||
|
global.stream_data.subscribed_streams = function () {
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
|
global.narrow.stream = function () {
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
var suggestions = search.get_suggestions(query);
|
||||||
|
|
||||||
|
var expected = [
|
||||||
|
"stream:Denmark topic:Hamlet shakespeare",
|
||||||
|
"stream:Denmark topic:Hamlet",
|
||||||
|
"stream:Denmark"
|
||||||
|
];
|
||||||
|
|
||||||
|
assert.deepEqual(suggestions.strings, expected);
|
||||||
|
}());
|
||||||
|
|
||||||
(function test_empty_query_suggestions() {
|
(function test_empty_query_suggestions() {
|
||||||
var query = '';
|
var query = '';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue