mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	@@ -170,14 +170,29 @@ run_test("hash_interactions", ({override}) => {
 | 
				
			|||||||
    window_stub = $.create("window-stub");
 | 
					    window_stub = $.create("window-stub");
 | 
				
			||||||
    page_params.default_view = "recent_topics";
 | 
					    page_params.default_view = "recent_topics";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    override(recent_topics_ui, "show", () => {});
 | 
					 | 
				
			||||||
    override(recent_topics_util, "is_visible", () => false);
 | 
					    override(recent_topics_util, "is_visible", () => false);
 | 
				
			||||||
    const helper = test_helper({override, change_tab: true});
 | 
					    const helper = test_helper({override, change_tab: true});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    window.location.hash = "#all_messages";
 | 
					    let recent_topics_ui_shown = false;
 | 
				
			||||||
 | 
					    override(recent_topics_ui, "show", () => {
 | 
				
			||||||
 | 
					        recent_topics_ui_shown = true;
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					    window.location.hash = "#unknown_hash";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    browser_history.clear_for_testing();
 | 
					    browser_history.clear_for_testing();
 | 
				
			||||||
    hashchange.initialize();
 | 
					    hashchange.initialize();
 | 
				
			||||||
 | 
					    // If it's an unknown hash it should show the default view.
 | 
				
			||||||
 | 
					    assert.equal(recent_topics_ui_shown, true);
 | 
				
			||||||
 | 
					    helper.assert_events([
 | 
				
			||||||
 | 
					        [overlays, "close_for_hash_change"],
 | 
				
			||||||
 | 
					        [message_viewport, "stop_auto_scrolling"],
 | 
				
			||||||
 | 
					    ]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    override(recent_topics_ui, "show", () => {});
 | 
				
			||||||
 | 
					    window.location.hash = "#all_messages";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    helper.clear_events();
 | 
				
			||||||
 | 
					    window_stub.trigger("hashchange");
 | 
				
			||||||
    helper.assert_events([
 | 
					    helper.assert_events([
 | 
				
			||||||
        [overlays, "close_for_hash_change"],
 | 
					        [overlays, "close_for_hash_change"],
 | 
				
			||||||
        [message_viewport, "stop_auto_scrolling"],
 | 
					        [message_viewport, "stop_auto_scrolling"],
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -179,6 +179,8 @@ function do_hashchange_normal(from_reload) {
 | 
				
			|||||||
        case "#about-zulip":
 | 
					        case "#about-zulip":
 | 
				
			||||||
            blueslip.error("overlay logic skipped for: " + hash);
 | 
					            blueslip.error("overlay logic skipped for: " + hash);
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					            show_default_view();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user