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.

zjquery: Tell dev about set_find_results.

Steve Howell2149a4627057
diff --git a/frontend_tests/zjsunit/zjquery_element.js b/frontend_tests/zjsunit/zjquery_element.js
index dc32bae829a..d42ea1a98df 100644
--- a/frontend_tests/zjsunit/zjquery_element.js
+++ b/frontend_tests/zjsunit/zjquery_element.js
@@ -80,7 +80,18 @@ function FakeElement(selector, opts) {
// if ($.find().length) { //success }
return [];
}
- throw new Error("Cannot find " + child_selector + " in " + selector);
+ throw new Error(`
+ We need you to simulate the results of $(...).find(...)
+ by using set_find_results. You want something like this:
+
+ const container = ...;
+ const child = ...;
+ container.set_find_results("${child_selector}", child);
+
+ Then calling container.find("${child_selector}") will return
+ the "child" zjquery element.
+
+ `);
},
get_on_handler(name, child_selector) {
return event_store.get_on_handler(name, child_selector);