mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
left sidebar: Disable "gray-out" feature for new users.
If a user has 30 subscribed streams or less, don't gray them out if they haven't had recent activity.
This commit is contained in:
@@ -281,9 +281,15 @@ run_test('subscribers', () => {
|
||||
run_test('is_active', () => {
|
||||
stream_data.clear_subscriptions();
|
||||
|
||||
var sub = {name: 'pets', subscribed: false, stream_id: 1};
|
||||
var sub;
|
||||
|
||||
sub = {name: 'pets', subscribed: false, stream_id: 111};
|
||||
stream_data.add_sub('pets', sub);
|
||||
|
||||
assert(stream_data.is_active(sub));
|
||||
|
||||
stream_data.set_filter_out_inactives(true);
|
||||
|
||||
assert(!stream_data.is_active(sub));
|
||||
|
||||
stream_data.subscribe_myself(sub);
|
||||
@@ -639,6 +645,7 @@ run_test('initialize', () => {
|
||||
initialize();
|
||||
page_params.realm_notifications_stream_id = -1;
|
||||
stream_data.initialize();
|
||||
assert(!stream_data.is_filtering_inactives());
|
||||
|
||||
const stream_names = stream_data.get_streams_for_admin().map(elem => elem.name);
|
||||
assert(stream_names.indexOf('subscriptions') !== -1);
|
||||
@@ -667,6 +674,34 @@ run_test('initialize', () => {
|
||||
assert.equal(page_params.notifications_stream, "foo");
|
||||
});
|
||||
|
||||
run_test('filter inactives', () => {
|
||||
page_params.unsubscribed = [];
|
||||
page_params.never_subscribed = [];
|
||||
page_params.subscriptions = [];
|
||||
|
||||
stream_data.initialize();
|
||||
assert(!stream_data.is_filtering_inactives());
|
||||
|
||||
page_params.unsubscribed = [];
|
||||
page_params.never_subscribed = [];
|
||||
page_params.subscriptions = [];
|
||||
|
||||
_.times(30, function (i) {
|
||||
var name = 'random' + i.toString();
|
||||
var stream_id = 100 + i;
|
||||
|
||||
var sub = {
|
||||
name: name,
|
||||
subscribed: true,
|
||||
newly_subscribed: false,
|
||||
stream_id: stream_id,
|
||||
};
|
||||
stream_data.add_sub(name, sub);
|
||||
});
|
||||
stream_data.initialize();
|
||||
assert(stream_data.is_filtering_inactives());
|
||||
});
|
||||
|
||||
run_test('get_newbie_stream', () => {
|
||||
var newbie = {
|
||||
name: 'newbie',
|
||||
|
||||
Reference in New Issue
Block a user