mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	node tests: Use proper variable names for tests.
Use proper variable names such as `alice.user_id` for assigning userId as a parameter instead of directly using a number `101` and avoid using a variable name `timestamp` for assigning message_ids to function `pm_conversations.recent.insert()`
This commit is contained in:
		@@ -55,9 +55,8 @@ function test(label, f) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
test("get_convos", ({override}) => {
 | 
			
		||||
    const timestamp = 0;
 | 
			
		||||
    pm_conversations.recent.insert([101, 102], timestamp);
 | 
			
		||||
    pm_conversations.recent.insert([103], timestamp);
 | 
			
		||||
    pm_conversations.recent.insert([alice.user_id, bob.user_id], 1);
 | 
			
		||||
    pm_conversations.recent.insert([me.user_id], 2);
 | 
			
		||||
    let num_unread_for_person = 1;
 | 
			
		||||
    override(unread, "num_unread_for_person", () => num_unread_for_person);
 | 
			
		||||
 | 
			
		||||
@@ -107,9 +106,8 @@ test("get_convos", ({override}) => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test("get_convos bot", ({override}) => {
 | 
			
		||||
    const timestamp = 0;
 | 
			
		||||
    pm_conversations.recent.insert([101, 102], timestamp);
 | 
			
		||||
    pm_conversations.recent.insert([bot_test.user_id], timestamp);
 | 
			
		||||
    pm_conversations.recent.insert([alice.user_id, bob.user_id], 1);
 | 
			
		||||
    pm_conversations.recent.insert([bot_test.user_id], 2);
 | 
			
		||||
 | 
			
		||||
    override(unread, "num_unread_for_person", () => 1);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user