mirror of https://github.com/zulip/zulip.git
node_tests: Remove duplicate jQuery stubs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
ce42d1194d
commit
493294b2a9
|
@ -14,10 +14,6 @@ const template = fs.readFileSync("templates/corporate/billing.html", "utf-8");
|
|||
const dom = new JSDOM(template, {pretendToBeVisual: true});
|
||||
const document = dom.window.document;
|
||||
|
||||
let jquery_init;
|
||||
set_global("$", (f) => {
|
||||
jquery_init = f;
|
||||
});
|
||||
set_global("helpers", {
|
||||
set_tab: noop,
|
||||
});
|
||||
|
@ -25,7 +21,6 @@ set_global("StripeCheckout", {
|
|||
configure: noop,
|
||||
});
|
||||
|
||||
zrequire("billing", "js/billing/billing");
|
||||
set_global("$", make_zjquery());
|
||||
|
||||
run_test("initialize", () => {
|
||||
|
@ -75,7 +70,7 @@ run_test("initialize", () => {
|
|||
$("#payment-method").data = (key) =>
|
||||
document.querySelector("#payment-method").getAttribute("data-" + key);
|
||||
|
||||
jquery_init();
|
||||
zrequire("billing", "js/billing/billing");
|
||||
|
||||
assert(set_tab_called);
|
||||
assert(stripe_checkout_configure_called);
|
||||
|
|
|
@ -4,11 +4,9 @@ const {strict: assert} = require("assert");
|
|||
|
||||
const {JSDOM} = require("jsdom");
|
||||
|
||||
const {set_global, stub_out_jquery, zrequire} = require("../zjsunit/namespace");
|
||||
const {set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
stub_out_jquery();
|
||||
|
||||
set_global("page_params", {
|
||||
development_environment: true,
|
||||
});
|
||||
|
|
|
@ -2,14 +2,13 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {set_global, stub_out_jquery, zrequire} = require("../zjsunit/namespace");
|
||||
const {set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const {make_zjquery} = require("../zjsunit/zjquery");
|
||||
|
||||
zrequire("unread");
|
||||
zrequire("stream_data");
|
||||
const people = zrequire("people");
|
||||
stub_out_jquery();
|
||||
set_global("$", make_zjquery());
|
||||
zrequire("message_util", "js/message_util");
|
||||
zrequire("Filter", "js/filter");
|
||||
|
|
|
@ -13,8 +13,6 @@ set_global("page_params", {
|
|||
is_guest: false,
|
||||
});
|
||||
|
||||
set_global("$", () => {});
|
||||
|
||||
set_global("document", null);
|
||||
stub_out_jquery();
|
||||
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {set_global, stub_out_jquery, zrequire} = require("../zjsunit/namespace");
|
||||
const {set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const {make_zjquery} = require("../zjsunit/zjquery");
|
||||
|
||||
stub_out_jquery();
|
||||
|
||||
set_global("ui", {
|
||||
get_content_element: (element) => element,
|
||||
get_scroll_element: (element) => element,
|
||||
|
|
|
@ -13,15 +13,10 @@ const template = fs.readFileSync("templates/analytics/realm_details.html", "utf-
|
|||
const dom = new JSDOM(template, {pretendToBeVisual: true});
|
||||
const document = dom.window.document;
|
||||
|
||||
let jquery_init;
|
||||
set_global("$", (f) => {
|
||||
jquery_init = f;
|
||||
});
|
||||
zrequire("support", "js/analytics/support");
|
||||
set_global("$", make_zjquery());
|
||||
|
||||
run_test("scrub_realm", () => {
|
||||
jquery_init();
|
||||
zrequire("support", "js/analytics/support");
|
||||
const click_handler = $("body").get_on_handler("click", ".scrub-realm-button");
|
||||
|
||||
const fake_this = $.create("fake-.scrub-realm-button");
|
||||
|
|
|
@ -13,11 +13,6 @@ const noop = () => {};
|
|||
const template = fs.readFileSync("templates/corporate/upgrade.html", "utf-8");
|
||||
const dom = new JSDOM(template, {pretendToBeVisual: true});
|
||||
const document = dom.window.document;
|
||||
let jquery_init;
|
||||
|
||||
set_global("$", (f) => {
|
||||
jquery_init = f;
|
||||
});
|
||||
|
||||
set_global("helpers", {
|
||||
set_tab: noop,
|
||||
|
@ -35,7 +30,6 @@ set_global("page_params", {
|
|||
});
|
||||
|
||||
zrequire("helpers", "js/billing/helpers");
|
||||
zrequire("upgrade", "js/billing/upgrade");
|
||||
set_global("$", make_zjquery());
|
||||
|
||||
run_test("initialize", () => {
|
||||
|
@ -109,7 +103,7 @@ run_test("initialize", () => {
|
|||
$("#autopay-form").data = (key) =>
|
||||
document.querySelector("#autopay-form").getAttribute("data-" + key);
|
||||
|
||||
jquery_init();
|
||||
zrequire("upgrade", "js/billing/upgrade");
|
||||
|
||||
const e = {
|
||||
preventDefault: noop,
|
||||
|
|
Loading…
Reference in New Issue