mirror of https://github.com/zulip/zulip.git
node tests: Cover stream_data.get_newbie_stream.
This commit is contained in:
parent
e62d9742aa
commit
0966f4737b
|
@ -635,3 +635,33 @@ zrequire('marked', 'third/marked/lib/marked');
|
|||
|
||||
assert.equal(page_params.notifications_stream, "foo");
|
||||
}());
|
||||
|
||||
(function test_get_newbie_stream() {
|
||||
var newbie = {
|
||||
name: 'newbie',
|
||||
stream_id: 234,
|
||||
subscribed: true,
|
||||
in_home_view: true,
|
||||
};
|
||||
|
||||
var new_members = {
|
||||
subscribed: true,
|
||||
name: 'new members',
|
||||
stream_id: 531,
|
||||
};
|
||||
|
||||
assert.equal(stream_data.get_newbie_stream(), undefined);
|
||||
|
||||
stream_data.add_sub('newbie', newbie);
|
||||
page_params.notifications_stream = 'newbie';
|
||||
assert.equal(stream_data.get_newbie_stream(), 'newbie');
|
||||
|
||||
newbie.in_home_view = false;
|
||||
assert.equal(stream_data.get_newbie_stream(), undefined);
|
||||
|
||||
stream_data.add_sub('new members', new_members);
|
||||
assert.equal(stream_data.get_newbie_stream(), 'new members');
|
||||
|
||||
new_members.subscribed = false;
|
||||
assert.equal(stream_data.get_newbie_stream(), undefined);
|
||||
}());
|
||||
|
|
Loading…
Reference in New Issue