mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Clarify Filter tests dealing with bogus operators
(imported from commit db8327eb6df70bc8ffee7fb8166bc6491bd2fe70)
This commit is contained in:
parent
ec5bfa2a10
commit
f8c3b70ced
@ -97,10 +97,6 @@ var Filter = require('js/filter.js');
|
||||
assert(!predicate({stream: 'unsub'}));
|
||||
assert(predicate({type: 'private'}));
|
||||
|
||||
// hack to get line coverage
|
||||
predicate = get_predicate([['in', 'bogus']]);
|
||||
predicate({});
|
||||
|
||||
predicate = get_predicate([['near', 5]]);
|
||||
assert(predicate({}));
|
||||
|
||||
@ -132,6 +128,19 @@ var Filter = require('js/filter.js');
|
||||
|
||||
predicate = get_predicate();
|
||||
assert(predicate({}));
|
||||
|
||||
// Upstream code should prevent Filter.predicate from being called with
|
||||
// invalid operator/operand combinations, but right now we just silently
|
||||
// return a function that accepts all messages.
|
||||
predicate = get_predicate([['in', 'bogus']]);
|
||||
assert(predicate({}));
|
||||
|
||||
predicate = get_predicate([['bogus', 33]]);
|
||||
assert(predicate({}));
|
||||
|
||||
predicate = get_predicate([['is', 'bogus']]);
|
||||
assert(predicate({}));
|
||||
|
||||
}());
|
||||
|
||||
(function test_parse_and_unparse() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user