mirror of https://github.com/zulip/zulip.git
node tests: Enforce 100% coverage for stream_data.js.
This commit is contained in:
parent
154436140b
commit
470e57db49
|
@ -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);
|
||||
}());
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue