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: Remove unused popover stub.

Anders Kaseorg0acd3f487947
diff --git a/web/tests/lib/zjquery.cjs b/web/tests/lib/zjquery.cjs
index 0437afdeeb8..1dab6048529 100644
--- a/web/tests/lib/zjquery.cjs
+++ b/web/tests/lib/zjquery.cjs
@@ -38,13 +38,8 @@ function verify_selector_for_zulip(selector) {
function make_zjquery() {
const elems = new Map();
- // Our fn structure helps us simulate extending jQuery.
- // Use this with extreme caution.
- const fn = {};
-
function new_elem(selector, create_opts) {
const $elem = FakeJQuery(selector, {...create_opts});
- Object.assign($elem, fn);
// Create a proxy handler to detect missing stubs.
//
@@ -127,35 +122,6 @@ function make_zjquery() {
zjquery.Event = FakeEvent;
- /* istanbul ignore next */
- fn.popover = () => {
- throw new Error(`
- Do not try to test $.fn.popover code unless
- you really know what you are doing.
- `);
- };
-
- zjquery.fn = new Proxy(fn, {
- set(_obj, _prop, _value) {
- /* istanbul ignore next */
- throw new Error(`
- Please don't use node tests to test code
- that extends $.fn unless you really know
- what you are doing.
-
- It's likely that you are better off testing
- end-to-end behavior with puppeteer tests.
-
- If you are trying to get coverage on a module
- that extends $.fn, and you just want to skip
- over that aspect of the module for the purpose
- of testing, see if you can wrap the code
- that extends $.fn and use override() to
- replace the wrapper with tests.lib.noop.
- `);
- },
- });
-
zjquery.reset_selector = (selector) => {
elems.delete(selector);
};