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.

support: Fix scrubbing realms if string_id is a number.

Mateusz Manderaca0869eb0154
diff --git a/web/src/analytics/support.ts b/web/src/analytics/support.ts
index 45ddab477ad..f7d56eb64d1 100644
--- a/web/src/analytics/support.ts
+++ b/web/src/analytics/support.ts
@@ -7,7 +7,7 @@ $(() => {
e.preventDefault();
const message =
"Confirm the string_id of the realm you want to scrub.\n\n WARNING! This action is irreversible!";
- const actual_string_id = $(this).data("string-id");
+ const actual_string_id = $(this).attr("data-string-id");
// eslint-disable-next-line no-alert
const confirmed_string_id = window.prompt(message);
if (confirmed_string_id === actual_string_id) {
diff --git a/web/tests/support.test.js b/web/tests/support.test.js
index 47303bd3ae8..7fcd852074a 100644
--- a/web/tests/support.test.js
+++ b/web/tests/support.test.js
@@ -24,8 +24,8 @@ run_test("scrub_realm", () => {
const click_handler = $("body").get_on_handler("click", ".scrub-realm-button");
const $fake_this = $.create("fake-.scrub-realm-button");
- $fake_this.data = (name) => {
- assert.equal(name, "string-id");
+ $fake_this.attr = (name) => {
+ assert.equal(name, "data-string-id");
return "zulip";
};