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 tests: Test empty string for input_pill.

Steve Howellff09d8af0396
diff --git a/frontend_tests/node_tests/input_pill.js b/frontend_tests/node_tests/input_pill.js
index c906f7ed027..cfeaf74d26c 100644
--- a/frontend_tests/node_tests/input_pill.js
+++ b/frontend_tests/node_tests/input_pill.js
@@ -566,7 +566,7 @@ run_test("misc things", () => {
container_click_handler.call(this_, {target: this_});
});
-run_test("clear", () => {
+run_test("appendValue/clear", () => {
const pill_input = $.create("pill_input");
const container = $.create("container");
container.set_find_results(".input", pill_input);
@@ -582,6 +582,11 @@ run_test("clear", () => {
const widget = input_pill.create(config);
+ // First test some early-exit code.
+ widget.appendValue("");
+ assert.deepEqual(widget._get_pills_for_testing(), []);
+
+ // Now set up real data.
widget.appendValue("red,yellow,blue");
const pills = widget._get_pills_for_testing();
diff --git a/frontend_tests/node_tests/upload.js b/frontend_tests/node_tests/upload.js
index fb2b996c580..276c7ffffa1 100644
--- a/frontend_tests/node_tests/upload.js
+++ b/frontend_tests/node_tests/upload.js
@@ -41,9 +41,7 @@ run_test("feature_check", (override) => {
upload.feature_check(upload_button);
assert(upload_button.hasClass("notdisplayed"));
- override(window, "XMLHttpRequest", function () {
- return {upload: true};
- });
+ override(window, "XMLHttpRequest", () => ({upload: true}));
upload.feature_check(upload_button);
assert(!upload_button.hasClass("notdisplayed"));
});