mirror of https://github.com/zulip/zulip.git
filter.js: Add test coverage for group-pm-with.
Added one little additional test in people.js to get up to 100% coverage.
This commit is contained in:
parent
1c0043ea47
commit
0da74f4d6d
|
@ -328,6 +328,27 @@ function make_sub(name, stream_id) {
|
||||||
type: 'private',
|
type: 'private',
|
||||||
display_recipient: [{id: joe.user_id}],
|
display_recipient: [{id: joe.user_id}],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
predicate = get_predicate([['group-pm-with', 'nobody@example.com']]);
|
||||||
|
assert(!predicate({
|
||||||
|
type: 'private',
|
||||||
|
display_recipient: [{id: joe.user_id}],
|
||||||
|
}));
|
||||||
|
|
||||||
|
predicate = get_predicate([['group-pm-with', 'Joe@example.com']]);
|
||||||
|
assert(predicate({
|
||||||
|
type: 'private',
|
||||||
|
display_recipient: [{id: joe.user_id}, {id: steve.user_id}, {id: me.user_id}],
|
||||||
|
}));
|
||||||
|
assert(!predicate({ // you must be a part of the group pm
|
||||||
|
type: 'private',
|
||||||
|
display_recipient: [{id: joe.user_id}, {id: steve.user_id}],
|
||||||
|
}));
|
||||||
|
assert(!predicate({
|
||||||
|
type: 'private',
|
||||||
|
display_recipient: [{id: steve.user_id}, {id: me.user_id}],
|
||||||
|
}));
|
||||||
|
assert(!predicate({type: 'stream'}));
|
||||||
}());
|
}());
|
||||||
|
|
||||||
(function test_negated_predicates() {
|
(function test_negated_predicates() {
|
||||||
|
|
|
@ -572,6 +572,7 @@ initialize();
|
||||||
assert.equal(msg, 'Empty recipient list in message');
|
assert.equal(msg, 'Empty recipient list in message');
|
||||||
};
|
};
|
||||||
people.pm_with_user_ids(message);
|
people.pm_with_user_ids(message);
|
||||||
|
people.group_pm_with_user_ids(message);
|
||||||
|
|
||||||
var charles = {
|
var charles = {
|
||||||
email: 'charles@example.com',
|
email: 'charles@example.com',
|
||||||
|
|
Loading…
Reference in New Issue