Add test coverage for stream_data.home_view_stream_names.

As part of this, I also made test_basics() have a third
stream that makes false positives in the test less likely.

(imported from commit d5ba64ec9346741818e30abe9e9594788c339fab)
This commit is contained in:
Steve Howell 2014-02-20 11:57:30 -05:00 committed by Jessica McKellar
parent f9d5a02710
commit 7f2f1ad533
1 changed files with 14 additions and 4 deletions

View File

@ -22,16 +22,26 @@ var stream_data = require('js/stream_data.js');
in_home_view: true,
invite_only: true
};
var test = {
subscribed: true,
color: 'yellow',
name: 'test',
stream_id: 3,
in_home_view: false,
invite_only: false
};
stream_data.add_sub('Denmark', denmark);
stream_data.add_sub('social', social);
assert(stream_data.all_subscribed_streams_are_in_home_view());
stream_data.add_sub('test', test);
assert(!stream_data.all_subscribed_streams_are_in_home_view());
assert.equal(stream_data.get_sub('denmark'), denmark);
assert.equal(stream_data.get_sub('Social'), social);
assert.deepEqual(stream_data.subscribed_streams(), ['social']);
assert.deepEqual(stream_data.get_colors(), ['red']);
assert(stream_data.all_subscribed_streams_are_in_home_view());
assert.deepEqual(stream_data.home_view_stream_names(), ['social']);
assert.deepEqual(stream_data.subscribed_streams(), ['social', 'test']);
assert.deepEqual(stream_data.get_colors(), ['red', 'yellow']);
assert(stream_data.is_subscribed('social'));
assert(stream_data.is_subscribed('Social'));