mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
node tests: Add coverage for clear_search_form.
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
a9f83a5805
commit
097852bb06
@@ -28,6 +28,18 @@ set_global("setTimeout", (func) => func());
|
||||
|
||||
const search = zrequire("search");
|
||||
|
||||
run_test("clear_search_form", () => {
|
||||
$("#search_query").val("noise");
|
||||
$("#search_query").trigger("focus");
|
||||
$(".search_button").prop("disabled", false);
|
||||
|
||||
search.clear_search_form();
|
||||
|
||||
assert.equal($("#search_query").is_focused(), false);
|
||||
assert.equal($("#search_query").val(), "");
|
||||
assert.equal($(".search_button").prop("disabled"), true);
|
||||
});
|
||||
|
||||
run_test("update_button_visibility", () => {
|
||||
const $search_query = $("#search_query");
|
||||
const $search_button = $(".search_button");
|
||||
|
||||
Reference in New Issue
Block a user