From 92259094b73aae76cb2d6f89153ae2a9f494b9f8 Mon Sep 17 00:00:00 2001 From: Rohitt Vashishtha Date: Tue, 10 Jul 2018 15:16:10 +0530 Subject: [PATCH] node_tests: Add missing stream_id field to tests in stream_data. These were resulting in inadvertant calls to blueslip.fatal but the code continued beyond that point, since in our testing environment we do not stop executing when fatal is called. This commit also adds checks to ensure that the subs were created. --- frontend_tests/node_tests/stream_data.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend_tests/node_tests/stream_data.js b/frontend_tests/node_tests/stream_data.js index 5e11f5e783..e5ff633f26 100644 --- a/frontend_tests/node_tests/stream_data.js +++ b/frontend_tests/node_tests/stream_data.js @@ -625,14 +625,17 @@ run_test('initialize_from_page_params', () => { function initialize() { page_params.subscriptions = [{ name: 'subscriptions', + stream_id: '2001', }]; page_params.unsubscribed = [{ name: 'unsubscribed', + stream_id: '2002', }]; page_params.never_subscribed = [{ name: 'never_subscribed', + stream_id: '2003', }]; } @@ -640,6 +643,10 @@ run_test('initialize_from_page_params', () => { page_params.realm_notifications_stream_id = -1; stream_data.initialize_from_page_params(); + const stream_names = stream_data.get_streams_for_admin().map(elem => elem.name); + assert(stream_names.indexOf('subscriptions') !== -1); + assert(stream_names.indexOf('unsubscribed') !== -1); + assert(stream_names.indexOf('never_subscribed') !== -1); assert(!page_params.subscriptions); assert(!page_params.unsubscribed); assert(!page_params.never_subscribed);