mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Simplify rendering of "more topics" link.
We now use a template to render the "more topics" link. We also remove an unnecessary conditional and an unnecessary attribute. Finally, our unit tests are a bit more granular now.
This commit is contained in:
		@@ -828,6 +828,13 @@ function render(template_name, args) {
 | 
			
		||||
    assert($(html).find(".message_reaction").has(".emoji .emoji-smile"));
 | 
			
		||||
}());
 | 
			
		||||
 | 
			
		||||
(function more_topics() {
 | 
			
		||||
    var html = render('more_topics');
 | 
			
		||||
    global.write_handlebars_output("more_topics", html);
 | 
			
		||||
 | 
			
		||||
    assert($(html).hasClass('show-more-topics'));
 | 
			
		||||
}());
 | 
			
		||||
 | 
			
		||||
(function new_stream_users() {
 | 
			
		||||
    var args = {
 | 
			
		||||
        users: [
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,13 @@ zrequire('topic_list');
 | 
			
		||||
 | 
			
		||||
    assert.equal(topic_list.active_stream_id(), undefined);
 | 
			
		||||
 | 
			
		||||
    var widget = topic_list.rebuild(parent_elem, stream_id);
 | 
			
		||||
    var widget = topic_list.widget(parent_elem, stream_id);
 | 
			
		||||
 | 
			
		||||
    widget.build_more_topics_section = function () {
 | 
			
		||||
        return $('<more topics>');
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    widget.build();
 | 
			
		||||
 | 
			
		||||
    assert(widget.is_for_stream(stream_id));
 | 
			
		||||
    assert.equal(widget.get_parent(), parent_elem);
 | 
			
		||||
@@ -90,8 +96,7 @@ zrequire('topic_list');
 | 
			
		||||
    assert(checked_mutes);
 | 
			
		||||
    assert(rendered);
 | 
			
		||||
    assert.equal(list_items[0].html(), '<topic list item>');
 | 
			
		||||
    assert.equal(list_items[1], $('<li class="show-more-topics">'));
 | 
			
		||||
    assert.equal(list_items[1].html(), '<more topics>');
 | 
			
		||||
    assert(attached_to_parent);
 | 
			
		||||
 | 
			
		||||
    assert.equal(topic_list.active_stream_id(), stream_id);
 | 
			
		||||
}());
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user