mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
pm_list: Handle narrow functions separately for pm_section.
This commit is a preparatory commit which introduces `handle_narrow_deactivated` and `handle_narrow_activated` functions in pm_list.js, separately from top_left_corner.js, to reduce the complexity of handling private messages section separately.
This commit is contained in:
@@ -30,7 +30,7 @@ run_test("narrowing", ({override}) => {
|
||||
|
||||
assert.ok(!pm_expanded);
|
||||
let filter = new Filter([{operator: "is", operand: "private"}]);
|
||||
top_left_corner.handle_narrow_activated(filter);
|
||||
pm_list.handle_narrow_activated(filter);
|
||||
assert.ok(pm_expanded);
|
||||
|
||||
const alice = {
|
||||
@@ -49,23 +49,23 @@ run_test("narrowing", ({override}) => {
|
||||
|
||||
pm_expanded = false;
|
||||
filter = new Filter([{operator: "pm-with", operand: "alice@example.com"}]);
|
||||
top_left_corner.handle_narrow_activated(filter);
|
||||
pm_list.handle_narrow_activated(filter);
|
||||
assert.ok(pm_expanded);
|
||||
|
||||
pm_expanded = false;
|
||||
filter = new Filter([{operator: "pm-with", operand: "bob@example.com,alice@example.com"}]);
|
||||
top_left_corner.handle_narrow_activated(filter);
|
||||
pm_list.handle_narrow_activated(filter);
|
||||
assert.ok(pm_expanded);
|
||||
|
||||
pm_expanded = false;
|
||||
filter = new Filter([{operator: "pm-with", operand: "not@valid.com"}]);
|
||||
top_left_corner.handle_narrow_activated(filter);
|
||||
pm_list.handle_narrow_activated(filter);
|
||||
assert.ok(!pm_expanded);
|
||||
|
||||
pm_expanded = false;
|
||||
people.deactivate(alice);
|
||||
filter = new Filter([{operator: "pm-with", operand: "alice@example.com"}]);
|
||||
top_left_corner.handle_narrow_activated(filter);
|
||||
pm_list.handle_narrow_activated(filter);
|
||||
assert.ok(pm_expanded);
|
||||
|
||||
filter = new Filter([{operator: "is", operand: "mentioned"}]);
|
||||
@@ -84,6 +84,7 @@ run_test("narrowing", ({override}) => {
|
||||
|
||||
pm_closed = false;
|
||||
top_left_corner.handle_narrow_deactivated();
|
||||
pm_list.handle_narrow_deactivated();
|
||||
|
||||
assert.ok($(".top_left_all_messages").hasClass("active-filter"));
|
||||
assert.ok(!$(".top_left_mentions").hasClass("active-filter"));
|
||||
|
||||
Reference in New Issue
Block a user