node tests: Enforce 100% coverage for stream_data.js.

This commit is contained in:
cPhost 2017-12-14 11:04:36 -05:00 committed by showell
parent 154436140b
commit 470e57db49
2 changed files with 30 additions and 0 deletions

View File

@ -674,3 +674,32 @@ zrequire('marked', 'third/marked/lib/marked');
new_members.subscribed = false;
assert.equal(stream_data.get_newbie_stream(), undefined);
}());
(function test_invite_streams() {
// add default stream
var orie = {
stream_id: 320,
name: 'Orie',
subscribed: true,
};
// clear all the data form stream_data, and people
stream_data.clear_subscriptions();
people.init();
stream_data.add_sub('Orie', orie);
stream_data.set_realm_default_streams([orie]);
var expected_list = ['Orie'];
assert.deepEqual(stream_data.invite_streams(), expected_list);
var inviter = {
stream_id: 25,
name: 'Inviter',
subscribed: true,
};
stream_data.add_sub('Inviter', inviter);
expected_list.push('Inviter');
assert.deepEqual(stream_data.invite_streams(), expected_list);
}());

View File

@ -49,6 +49,7 @@ enforce_fully_covered = {
'static/js/recent_senders.js',
'static/js/rtl.js',
'static/js/search_suggestion.js',
'static/js/stream_data.js',
'static/js/stream_events.js',
'static/js/stream_sort.js',
'static/js/topic_data.js',