mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
node tests: Add whiny_get() helper.
This commit is contained in:
committed by
Steve Howell
parent
764b83b890
commit
433d42e723
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
const {strict: assert} = require("assert");
|
const {strict: assert} = require("assert");
|
||||||
|
|
||||||
const {mock_cjs, mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
const {mock_cjs, mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||||
const {run_test} = require("../zjsunit/test");
|
const {run_test} = require("../zjsunit/test");
|
||||||
const $ = require("../zjsunit/zjquery");
|
const $ = require("../zjsunit/zjquery");
|
||||||
|
|
||||||
@@ -371,12 +371,14 @@ test("quote_and_reply", (override) => {
|
|||||||
raw_content: "Testing.",
|
raw_content: "Testing.",
|
||||||
};
|
};
|
||||||
|
|
||||||
channel.get = () => {
|
function whiny_get() {
|
||||||
assert.fail("channel.get should not be used if raw_content is present");
|
assert.fail("channel.get should not be used if raw_content is present");
|
||||||
};
|
}
|
||||||
|
|
||||||
replaced = false;
|
replaced = false;
|
||||||
|
with_field(channel, "get", whiny_get, () => {
|
||||||
quote_and_reply(opts);
|
quote_and_reply(opts);
|
||||||
|
});
|
||||||
assert(replaced);
|
assert(replaced);
|
||||||
|
|
||||||
selected_message = {
|
selected_message = {
|
||||||
|
|||||||
Reference in New Issue
Block a user