Cover more variations of narrowing in test_describe()

(imported from commit 145e9f624ea460c62a62f3da2d8e328642c5e2d6)
This commit is contained in:
Steve Howell
2014-02-19 11:26:48 -05:00
parent 55a862cc23
commit 2ca0015c0a

View File

@@ -398,6 +398,42 @@ function get_predicate(operators) {
string = 'Narrow to all private messages, Search for lunch';
assert.equal(Filter.describe(narrow), string);
narrow = [
{operator: 'id', operand: 99}
];
string = 'Narrow to message ID 99';
assert.equal(Filter.describe(narrow), string);
narrow = [
{operator: 'in', operand: 'home'}
];
string = 'Narrow to messages in home';
assert.equal(Filter.describe(narrow), string);
narrow = [
{operator: 'is', operand: 'mentioned'}
];
string = 'Narrow to mentioned messages';
assert.equal(Filter.describe(narrow), string);
narrow = [
{operator: 'is', operand: 'alerted'}
];
string = 'Narrow to alerted messages';
assert.equal(Filter.describe(narrow), string);
narrow = [
{operator: 'is', operand: 'something_we_do_not_support'}
];
string = 'Narrow to (unknown operator)';
assert.equal(Filter.describe(narrow), string);
narrow = [
{operator: 'bogus', operand: 'foo'}
];
string = 'Narrow to (unknown operator)';
assert.equal(Filter.describe(narrow), string);
narrow = [
{operator: 'stream', operand: 'devel'},
{operator: 'topic', operand: 'JS', negated: true}