mirror of https://github.com/zulip/zulip.git
Add test_get_and_set() to stream_data tests
(imported from commit 007486f08879ea8b98524a91ef3fc02565cc4d86)
This commit is contained in:
parent
bf0909a94d
commit
ca5cf073f4
|
@ -44,3 +44,14 @@ var stream_data = require('js/stream_data.js');
|
|||
assert.equal(stream_data.get_name('denMARK'), 'Denmark');
|
||||
assert.equal(stream_data.get_name('unknown Stream'), 'unknown Stream');
|
||||
}());
|
||||
|
||||
(function test_get_and_set() {
|
||||
stream_data.clear_subscriptions();
|
||||
stream_data.add_sub('Denmark', {name: 'Denmark', subscribed: true});
|
||||
assert.deepEqual(stream_data.subscribed_streams(), ['Denmark']);
|
||||
var info = stream_data.get_stream_info();
|
||||
stream_data.clear_subscriptions();
|
||||
assert.deepEqual(stream_data.subscribed_streams(), []);
|
||||
stream_data.set_stream_info(info);
|
||||
assert.deepEqual(stream_data.subscribed_streams(), ['Denmark']);
|
||||
}());
|
||||
|
|
Loading…
Reference in New Issue