Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
zjquery: Implement get.
Anders Kaseorg272e6dca803b
diff --git a/web/tests/compose_paste.test.cjs b/web/tests/compose_paste.test.cjsindex ecafb8a185e..2ebd1309760 100644--- a/web/tests/compose_paste.test.cjs+++ b/web/tests/compose_paste.test.cjs@@ -227,7 +227,6 @@ run_test("paste_handler reverse linkify", ({override, override_rewire}) => {// The URL paste path checks this before it reaches reverse-linkify.$textarea[0] = window.document.createElement("textarea");$textarea[0].value = "";- $textarea.get = () => $textarea[0];$textarea.range = () => ({start: 0, end: 0, text: "", length: 0});$textarea.caret = () => 0;inserted_text = undefined;diff --git a/web/tests/compose_ui.test.cjs b/web/tests/compose_ui.test.cjsindex e7c4f82ab9b..e2d406fffbc 100644--- a/web/tests/compose_ui.test.cjs+++ b/web/tests/compose_ui.test.cjs@@ -629,17 +629,15 @@ run_test("test_compose_height_changes", ({override, override_rewire}) => {});const $textarea = $("textarea#compose-textarea");-$textarea.get = () => ({- setSelectionRange(start, end) {- $textarea.range = () => ({- start,- end,- text: $textarea.val().slice(start, end),- length: end - start,- });- },- click() {},-});+$textarea[0].setSelectionRange = (start, end) => {+ $textarea.range = () => ({+ start,+ end,+ text: $textarea.val().slice(start, end),+ length: end - start,+ });+};+$textarea[0].click = () => {};// The argument `text_representation` is a string representing the text// in the compose box, where `<` and `>` denote the start and end of anydiff --git a/web/tests/lib/zjquery_element.cjs b/web/tests/lib/zjquery_element.cjsindex 54908cd30f3..c8ead63a033 100644--- a/web/tests/lib/zjquery_element.cjs+++ b/web/tests/lib/zjquery_element.cjs@@ -121,6 +121,9 @@ exports.FakeJQuery = function (selector, opts) {`);},+ get(index) {+ return index === undefined ? [...this] : this[index];+ },get_on_handler(name, child_selector) {return event_store.get_on_handler(name, child_selector);},diff --git a/web/tests/stream_data.test.cjs b/web/tests/stream_data.test.cjsindex 7a84207c97a..52e037faffd 100644--- a/web/tests/stream_data.test.cjs+++ b/web/tests/stream_data.test.cjs@@ -2580,9 +2580,7 @@ test("set_max_channel_width_css_variable", async () => {const $root = $(":root");$measure_div.css = () => $measure_div;- $measure_div.get = () => ({- getBoundingClientRect: () => ({width: $measure_div.text().length}),- });+ $measure_div[0].getBoundingClientRect = () => ({width: $measure_div.text().length});$measure_div.remove = () => {};const set_property_calls = [];