mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
Create narrow.update_email().
This commit is contained in:
@@ -200,3 +200,24 @@ function set_filter(operators) {
|
|||||||
assert.equal(hide_id,'.empty_feed_notice');
|
assert.equal(hide_id,'.empty_feed_notice');
|
||||||
assert.equal(show_id, '#empty_search_narrow_message');
|
assert.equal(show_id, '#empty_search_narrow_message');
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
(function test_update_email() {
|
||||||
|
var steve = {
|
||||||
|
email: 'steve@foo.com',
|
||||||
|
user_id: 43,
|
||||||
|
full_name: 'Steve',
|
||||||
|
};
|
||||||
|
|
||||||
|
people.add(steve);
|
||||||
|
set_filter([
|
||||||
|
['pm-with', 'steve@foo.com'],
|
||||||
|
['sender', 'steve@foo.com'],
|
||||||
|
['stream', 'steve@foo.com'], // try to be tricky
|
||||||
|
]);
|
||||||
|
narrow.update_email(steve.user_id, 'showell@foo.com');
|
||||||
|
var filter = narrow.filter();
|
||||||
|
assert.deepEqual(filter.operands('pm-with'), ['showell@foo.com']);
|
||||||
|
assert.deepEqual(filter.operands('sender'), ['showell@foo.com']);
|
||||||
|
assert.deepEqual(filter.operands('stream'), ['steve@foo.com']);
|
||||||
|
}());
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,13 @@ exports.operators = function () {
|
|||||||
return current_filter.operators();
|
return current_filter.operators();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.update_email = function (user_id, new_email) {
|
||||||
|
if (current_filter !== undefined) {
|
||||||
|
current_filter.update_email(user_id, new_email);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Operators we should send to the server. */
|
/* Operators we should send to the server. */
|
||||||
exports.public_operators = function () {
|
exports.public_operators = function () {
|
||||||
if (current_filter === undefined) {
|
if (current_filter === undefined) {
|
||||||
|
|||||||
Reference in New Issue
Block a user