Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

node_test: Avoid make_zjquery.

Steve Howell706e2baf7e50
diff --git a/frontend_tests/node_tests/compose.js b/frontend_tests/node_tests/compose.js
index d99dbc80a13..93097bb44c7 100644
--- a/frontend_tests/node_tests/compose.js
+++ b/frontend_tests/node_tests/compose.js
@@ -113,7 +113,7 @@ function stub_out_video_calls() {
function reset_jquery() {
// Avoid leaks.
- set_global("$", make_zjquery());
+ $.clear_all_elements();
}
const new_user = {
@@ -206,7 +206,7 @@ run_test("validate_stream_message_address_info", () => {
run_test("validate", () => {
function initialize_pm_pill() {
- set_global("$", make_zjquery());
+ reset_jquery();
$("#compose-send-button").prop("disabled", false);
$("#compose-send-button").trigger("focus");
@@ -1891,7 +1891,7 @@ run_test("create_message_object", () => {
});
run_test("nonexistent_stream_reply_error", () => {
- set_global("$", make_zjquery());
+ reset_jquery();
const actions = [];
$("#nonexistent_stream_reply_error").show = () => {
diff --git a/frontend_tests/node_tests/input_pill.js b/frontend_tests/node_tests/input_pill.js
index ea1bcf9f71c..c25863c6deb 100644
--- a/frontend_tests/node_tests/input_pill.js
+++ b/frontend_tests/node_tests/input_pill.js
@@ -93,7 +93,7 @@ run_test("basics", () => {
});
function set_up() {
- set_global("$", make_zjquery());
+ $.clear_all_elements();
const items = {
blue: {
display_value: "BLUE",
diff --git a/frontend_tests/node_tests/settings_bots.js b/frontend_tests/node_tests/settings_bots.js
index c0e5c2a4458..278f399e395 100644
--- a/frontend_tests/node_tests/settings_bots.js
+++ b/frontend_tests/node_tests/settings_bots.js
@@ -121,7 +121,7 @@ function test_create_bot_type_input_box_toggle(f) {
}
function set_up() {
- set_global("$", make_zjquery());
+ $.clear_all_elements();
// bunch of stubs
diff --git a/frontend_tests/node_tests/settings_user_groups.js b/frontend_tests/node_tests/settings_user_groups.js
index fe53bf28ae4..95e8210d6f2 100644
--- a/frontend_tests/node_tests/settings_user_groups.js
+++ b/frontend_tests/node_tests/settings_user_groups.js
@@ -393,7 +393,7 @@ run_test("with_external_user", () => {
};
// Reset zjquery to test stuff with user who cannot edit
- set_global("$", make_zjquery());
+ $.clear_all_elements();
let user_group_find_called = 0;
const user_group_stub = $(`div.user-group[id="${CSS.escape(1)}"]`);
diff --git a/frontend_tests/node_tests/upload.js b/frontend_tests/node_tests/upload.js
index 112417e1c84..345af29e7a0 100644
--- a/frontend_tests/node_tests/upload.js
+++ b/frontend_tests/node_tests/upload.js
@@ -368,7 +368,7 @@ run_test("uppy_config", () => {
});
run_test("file_input", () => {
- set_global("$", make_zjquery());
+ $.clear_all_elements();
upload.setup_upload({mode: "compose"});
@@ -391,8 +391,7 @@ run_test("file_input", () => {
});
run_test("file_drop", () => {
- set_global("$", make_zjquery());
-
+ $.clear_all_elements();
upload.setup_upload({mode: "compose"});
let prevent_default_counter = 0;
@@ -431,7 +430,7 @@ run_test("file_drop", () => {
});
run_test("copy_paste", () => {
- set_global("$", make_zjquery());
+ $.clear_all_elements();
upload.setup_upload({mode: "compose"});
@@ -472,7 +471,7 @@ run_test("copy_paste", () => {
});
run_test("uppy_events", () => {
- set_global("$", make_zjquery());
+ $.clear_all_elements();
const callbacks = {};
let uppy_cancel_all_called = false;
let state = {};