mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	node tests: Cover stream_data.name_in_home_view
This commit is contained in:
		@@ -461,3 +461,25 @@ zrequire('stream_data');
 | 
				
			|||||||
    assert(stream_data.receives_audible_notifications('India'));
 | 
					    assert(stream_data.receives_audible_notifications('India'));
 | 
				
			||||||
    assert(!stream_data.receives_audible_notifications('Indiana'));
 | 
					    assert(!stream_data.receives_audible_notifications('Indiana'));
 | 
				
			||||||
}());
 | 
					}());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(function test_in_home_view() {
 | 
				
			||||||
 | 
					  var tony = {
 | 
				
			||||||
 | 
					    stream_id: 999,
 | 
				
			||||||
 | 
					    name: 'tony',
 | 
				
			||||||
 | 
					    subscribed: true,
 | 
				
			||||||
 | 
					    in_home_view: true,
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  var jazy = {
 | 
				
			||||||
 | 
					    stream_id: 500,
 | 
				
			||||||
 | 
					    name: 'jazy',
 | 
				
			||||||
 | 
					    subscribed: false,
 | 
				
			||||||
 | 
					    in_home_view: false,
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  stream_data.add_sub('tony', tony);
 | 
				
			||||||
 | 
					  stream_data.add_sub('jazy', jazy);
 | 
				
			||||||
 | 
					  assert(stream_data.name_in_home_view('tony'));
 | 
				
			||||||
 | 
					  assert(!stream_data.name_in_home_view('jazy'));
 | 
				
			||||||
 | 
					  assert(!stream_data.name_in_home_view('EEXISTS'));
 | 
				
			||||||
 | 
					}());
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user