diff --git a/zerver/tests/frontend/node/stream_data.js b/zerver/tests/frontend/node/stream_data.js index 729f93de06..fd6d9fbb19 100644 --- a/zerver/tests/frontend/node/stream_data.js +++ b/zerver/tests/frontend/node/stream_data.js @@ -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']); +}());