From f923320de847e22ecff7e693619696ab3ba75dc1 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 10 Nov 2016 11:19:22 -0800 Subject: [PATCH] topic lists: Add get_stream_name() to topic list widget. --- frontend_tests/node_tests/topic_list.js | 1 + static/js/topic_list.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/frontend_tests/node_tests/topic_list.js b/frontend_tests/node_tests/topic_list.js index 243f323aa0..9561c00de1 100644 --- a/frontend_tests/node_tests/topic_list.js +++ b/frontend_tests/node_tests/topic_list.js @@ -35,6 +35,7 @@ global.compile_template('topic_list_item'); var topic_html = widget.get_dom(); assert.equal(widget.get_parent(), parent_elem); + assert.equal(widget.get_stream_name(), 'devel'); var topic = $(topic_html).find('a').text().trim(); assert.equal(topic, 'coding'); diff --git a/static/js/topic_list.js b/static/js/topic_list.js index b7021d35fd..29de8c8f6c 100644 --- a/static/js/topic_list.js +++ b/static/js/topic_list.js @@ -94,6 +94,10 @@ exports.build_widget = function (parent_elem, stream, active_topic, max_topics) return stream === stream_name; }; + self.get_stream_name = function () { + return stream; + }; + self.get_dom = function () { return self.dom; };