mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 04:12:02 +00:00
js: Convert static/js/search.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
9d9c716dd2
commit
b9137e3de8
@@ -15,7 +15,7 @@ set_global("location", {
|
||||
});
|
||||
set_global("to_$", () => window_stub);
|
||||
|
||||
set_global("search", {
|
||||
rewiremock("../../static/js/search").with({
|
||||
update_button_visibility: () => {},
|
||||
});
|
||||
set_global("document", "document-stub");
|
||||
|
||||
@@ -92,7 +92,8 @@ rewiremock("../../static/js/muting_ui").with(muting_ui);
|
||||
const narrow = set_global("narrow", {});
|
||||
const navigate = set_global("navigate", {});
|
||||
const reactions = set_global("reactions", {});
|
||||
const search = set_global("search", {});
|
||||
const search = {__esModule: true};
|
||||
rewiremock("../../static/js/search").with(search);
|
||||
const stream_list = set_global("stream_list", {});
|
||||
const subs = set_global("subs", {});
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@ rewiremock("../../static/js/message_scroll").with(message_scroll);
|
||||
set_global("message_util", {});
|
||||
const notifications = set_global("notifications", {});
|
||||
set_global("page_params", {});
|
||||
const search = set_global("search", {});
|
||||
const search = {__esModule: true};
|
||||
rewiremock("../../static/js/search").with(search);
|
||||
const stream_list = set_global("stream_list", {});
|
||||
const message_view_header = set_global("message_view_header", {});
|
||||
const top_left_corner = {__esModule: true};
|
||||
|
||||
@@ -195,7 +195,7 @@ run_test("initialize", () => {
|
||||
assert(!is_blurred);
|
||||
assert(is_append_search_string_called);
|
||||
|
||||
search.is_using_input_method = true;
|
||||
search.__Rewire__("is_using_input_method", true);
|
||||
_setup("stream:Verona");
|
||||
|
||||
assert.equal(opts.updater("stream:Verona"), "stream:Verona");
|
||||
@@ -222,7 +222,7 @@ run_test("initialize", () => {
|
||||
searchbox.trigger("focusout");
|
||||
assert.deepEqual(searchbox.css(), {"box-shadow": "unset"});
|
||||
|
||||
search.is_using_input_method = false;
|
||||
search.__Rewire__("is_using_input_method", false);
|
||||
searchbox_form.trigger("compositionend");
|
||||
assert(search.is_using_input_method);
|
||||
|
||||
@@ -303,7 +303,7 @@ run_test("initialize", () => {
|
||||
assert(is_blurred);
|
||||
|
||||
_setup("ver");
|
||||
search.is_using_input_method = true;
|
||||
search.__Rewire__("is_using_input_method", true);
|
||||
searchbox_form.trigger(ev);
|
||||
// No change on Enter keyup event when using input tool
|
||||
assert(!is_blurred);
|
||||
|
||||
@@ -161,7 +161,7 @@ run_test("initialize", () => {
|
||||
assert.equal(opts.updater("stream:Verona"), "stream:Verona");
|
||||
assert(is_blurred);
|
||||
|
||||
search.is_using_input_method = true;
|
||||
search.__Rewire__("is_using_input_method", true);
|
||||
_setup("stream:Verona");
|
||||
assert.equal(opts.updater("stream:Verona"), "stream:Verona");
|
||||
assert(!is_blurred);
|
||||
@@ -181,7 +181,7 @@ run_test("initialize", () => {
|
||||
search_query_box.trigger("blur");
|
||||
assert.equal(search_query_box.val(), "test string");
|
||||
|
||||
search.is_using_input_method = false;
|
||||
search.__Rewire__("is_using_input_method", false);
|
||||
searchbox_form.trigger("compositionend");
|
||||
assert(search.is_using_input_method);
|
||||
|
||||
@@ -261,7 +261,7 @@ run_test("initialize", () => {
|
||||
assert(is_blurred);
|
||||
|
||||
_setup("ver");
|
||||
search.is_using_input_method = true;
|
||||
search.__Rewire__("is_using_input_method", true);
|
||||
searchbox_form.trigger(ev);
|
||||
// No change on Enter keyup event when using input tool
|
||||
assert(!is_blurred);
|
||||
|
||||
@@ -119,7 +119,6 @@ const upload = zrequire("upload");
|
||||
const compose = zrequire("compose");
|
||||
zrequire("composebox_typeahead");
|
||||
zrequire("narrow");
|
||||
zrequire("search");
|
||||
zrequire("notifications");
|
||||
zrequire("stream_list");
|
||||
zrequire("starred_messages");
|
||||
|
||||
Reference in New Issue
Block a user