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.

tests: Remove unusual ‘this’ usage.

Anders Kaseorg37c9505a4694
diff --git a/web/tests/lib/events.cjs b/web/tests/lib/events.cjs
index 83120376f48..e9f6b1e69ef 100644
--- a/web/tests/lib/events.cjs
+++ b/web/tests/lib/events.cjs
@@ -144,8 +144,8 @@ exports.fixtures = {
message_id: 128,
recipient: {
type: "channel",
- channel_id: this.stream_typing_in_id,
- topic: this.topic_typing_in,
+ channel_id: exports.stream_typing_in_id,
+ topic: exports.topic_typing_in,
},
},
@@ -156,8 +156,8 @@ exports.fixtures = {
message_id: 128,
recipient: {
type: "channel",
- channel_id: this.stream_typing_in_id,
- topic: this.topic_typing_in,
+ channel_id: exports.stream_typing_in_id,
+ topic: exports.topic_typing_in,
},
},
@@ -746,8 +746,8 @@ exports.fixtures = {
op: "start",
message_type: "stream",
sender: typing_person1,
- stream_id: this.stream_typing_in_id,
- topic: this.topic_typing_in,
+ stream_id: exports.stream_typing_in_id,
+ topic: exports.topic_typing_in,
},
stream_typing__stop: {
@@ -755,8 +755,8 @@ exports.fixtures = {
op: "stop",
message_type: "stream",
sender: typing_person1,
- stream_id: this.stream_typing_in_id,
- topic: this.topic_typing_in,
+ stream_id: exports.stream_typing_in_id,
+ topic: exports.topic_typing_in,
},
submessage: {
diff --git a/web/tests/spoilers.test.cjs b/web/tests/spoilers.test.cjs
index c725abfb1ce..d8c52c39c3a 100644
--- a/web/tests/spoilers.test.cjs
+++ b/web/tests/spoilers.test.cjs
@@ -8,11 +8,11 @@ const $ = require("./lib/zjquery.cjs");
const spoilers = zrequire("spoilers");
-// This function is taken from rendered_markdown.ts and slightly modified.
+// This function is taken from rendered_markdown.test.ts and slightly modified.
const $array = (array) => {
const each = (func) => {
for (const [index, $elem] of array.entries()) {
- func.call(this, index, $elem);
+ func.call($elem, index, $elem);
}
};
return {each};