diff --git a/zerver/tests/frontend/node/filter.js b/zerver/tests/frontend/node/filter.js index 01bb343c16..d4b9aeee83 100644 --- a/zerver/tests/frontend/node/filter.js +++ b/zerver/tests/frontend/node/filter.js @@ -19,11 +19,6 @@ var Filter = global.Filter; var filter = new Filter(operators); assert.deepEqual(filter.operators(), operators); - - var predicate = filter.predicate(); - assert(predicate({type: 'stream', stream: 'foo', subject: 'bar'})); - assert(!predicate({type: 'stream', stream: 'foo', subject: 'whatever'})); - assert.deepEqual(filter.operands('stream'), ['foo']); assert(filter.has_operator('stream')); @@ -50,3 +45,14 @@ var Filter = global.Filter; assert.deepEqual(Filter.canonicalize_tuple(['Stream', 'Denmark']), ['stream', 'denmark']); }()); +(function test_predicates() { + var operators = [['stream', 'Foo'], ['topic', 'Bar']]; + var filter = new Filter(operators); + + var predicate = filter.predicate(); + assert(predicate({type: 'stream', stream: 'foo', subject: 'bar'})); + assert(!predicate({type: 'stream', stream: 'foo', subject: 'whatever'})); +}()); + + +