diff --git a/frontend_tests/node_tests/stream_data.js b/frontend_tests/node_tests/stream_data.js index 956ce837ff..afe3c7150d 100644 --- a/frontend_tests/node_tests/stream_data.js +++ b/frontend_tests/node_tests/stream_data.js @@ -601,6 +601,9 @@ run_test('notifications', () => { subscribed: true, desktop_notifications: null, audible_notifications: null, + email_notifications: null, + push_notifications: null, + wildcard_mentions_notify: null, }; stream_data.clear_subscriptions(); stream_data.add_sub('India', india); @@ -629,6 +632,36 @@ run_test('notifications', () => { page_params.enable_stream_audible_notifications = true; assert(!stream_data.receives_notifications('India', "desktop_notifications")); assert(!stream_data.receives_notifications('India', "audible_notifications")); + + page_params.wildcard_mentions_notify = true; + assert(stream_data.receives_notifications('India', "wildcard_mentions_notify")); + page_params.wildcard_mentions_notify = false; + assert(!stream_data.receives_notifications('India', "wildcard_mentions_notify")); + india.wildcard_mentions_notify = true; + assert(stream_data.receives_notifications('India', "wildcard_mentions_notify")); + page_params.wildcard_mentions_notify = true; + india.wildcard_mentions_notify = false; + assert(!stream_data.receives_notifications('India', "wildcard_mentions_notify")); + + page_params.enable_stream_push_notifications = true; + assert(stream_data.receives_notifications('India', "push_notifications")); + page_params.enable_stream_push_notifications = false; + assert(!stream_data.receives_notifications('India', "push_notifications")); + india.push_notifications = true; + assert(stream_data.receives_notifications('India', "push_notifications")); + page_params.enable_stream_push_notifications = true; + india.push_notifications = false; + assert(!stream_data.receives_notifications('India', "push_notifications")); + + page_params.enable_stream_email_notifications = true; + assert(stream_data.receives_notifications('India', "email_notifications")); + page_params.enable_stream_email_notifications = false; + assert(!stream_data.receives_notifications('India', "email_notifications")); + india.email_notifications = true; + assert(stream_data.receives_notifications('India', "email_notifications")); + page_params.enable_stream_email_notifications = true; + india.email_notifications = false; + assert(!stream_data.receives_notifications('India', "email_notifications")); }); run_test('is_muted', () => {