mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
message list: Stub with Error instead of asserting zero calls in tests.
This is a cleaner way of testing that the function
is not called, than using counters.
This code was added in 9cb41c2976.
This commit is contained in:
committed by
Tim Abbott
parent
4bd7ec7c36
commit
29bf97313a
@@ -120,17 +120,16 @@ run_test("muting", () => {
|
||||
|
||||
// `messages_filtered_for_topic_mutes` should skip filtering
|
||||
// messages if `excludes_muted_topics` is false.
|
||||
let is_topic_muted_calls = 0;
|
||||
|
||||
with_field(
|
||||
muting,
|
||||
"is_topic_muted",
|
||||
() => {
|
||||
is_topic_muted_calls = is_topic_muted_calls + 1;
|
||||
throw new Error(
|
||||
"Messages should not be filtered for topic mutes if excludes_muted_topics is false.",
|
||||
);
|
||||
},
|
||||
() => {
|
||||
const res = mld.messages_filtered_for_topic_mutes(msgs);
|
||||
assert.equal(is_topic_muted_calls, 0);
|
||||
assert.deepEqual(res, msgs);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user