mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	compose_closed_ui: Show default label for empty narrows.
The default label for empty narrows depends on whether it's a stream/topic narrow or a PMs narrow. We leave some default text in compose.hbs for reply label because it take some time for the js to display the correct label.
This commit is contained in:
		@@ -99,3 +99,10 @@ run_test("test_custom_message_input", () => {
 | 
			
		||||
    });
 | 
			
		||||
    test_reply_label("#stream test > topic test");
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
run_test("empty_narrow", () => {
 | 
			
		||||
    message_lists.current.empty = () => true;
 | 
			
		||||
    compose_closed_ui.update_reply_recipient_label();
 | 
			
		||||
    const label = $(".compose_reply_button_label").text();
 | 
			
		||||
    assert.equal(label, "translated: Compose message");
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -97,17 +97,11 @@ run_test("uris", () => {
 | 
			
		||||
run_test("show_empty_narrow_message", () => {
 | 
			
		||||
    page_params.stop_words = [];
 | 
			
		||||
 | 
			
		||||
    $("#left_bar_compose_reply_button_big").prop("disabled", false);
 | 
			
		||||
    narrow_state.reset_current_filter();
 | 
			
		||||
    hide_all_empty_narrow_messages();
 | 
			
		||||
    narrow_banner.show_empty_narrow_message();
 | 
			
		||||
    assert.equal($(".empty_feed_notice").visible(), false);
 | 
			
		||||
    assert($("#empty_narrow_message").visible());
 | 
			
		||||
    assert.equal(
 | 
			
		||||
        $("#left_bar_compose_reply_button_big").attr("title"),
 | 
			
		||||
        "translated: There are no messages to reply to.",
 | 
			
		||||
    );
 | 
			
		||||
    assert($("#left_bar_compose_reply_button_big").prop("disabled"));
 | 
			
		||||
 | 
			
		||||
    // for non-existent or private stream
 | 
			
		||||
    set_filter([["stream", "Foo"]]);
 | 
			
		||||
@@ -236,8 +230,6 @@ run_test("hide_empty_narrow_message", () => {
 | 
			
		||||
    $(".empty_feed_notice").show();
 | 
			
		||||
    narrow_banner.hide_empty_narrow_message();
 | 
			
		||||
    assert(!$(".empty_feed_notice").visible());
 | 
			
		||||
    assert.equal($("#left_bar_compose_reply_button_big").attr("title"), "translated: Reply (r)");
 | 
			
		||||
    assert(!$("#left_bar_compose_reply_button_big").prop("disabled"));
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
run_test("show_search_stopwords", () => {
 | 
			
		||||
 
 | 
			
		||||
@@ -15,6 +15,7 @@ const all_messages_data = mock_esm("../../static/js/all_messages_data");
 | 
			
		||||
const channel = mock_esm("../../static/js/channel");
 | 
			
		||||
const compose = mock_esm("../../static/js/compose");
 | 
			
		||||
const compose_actions = mock_esm("../../static/js/compose_actions");
 | 
			
		||||
const compose_closed_ui = mock_esm("../../static/js/compose_closed_ui");
 | 
			
		||||
const hashchange = mock_esm("../../static/js/hashchange");
 | 
			
		||||
const message_fetch = mock_esm("../../static/js/message_fetch");
 | 
			
		||||
const message_list = mock_esm("../../static/js/message_list", {
 | 
			
		||||
@@ -79,6 +80,7 @@ function test_helper() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    stub(compose_actions, "on_narrow");
 | 
			
		||||
    stub(compose_closed_ui, "update_reply_recipient_label");
 | 
			
		||||
    stub(hashchange, "save_narrow");
 | 
			
		||||
    stub(message_scroll, "hide_indicators");
 | 
			
		||||
    stub(message_scroll, "show_loading_older");
 | 
			
		||||
@@ -202,6 +204,7 @@ run_test("basics", () => {
 | 
			
		||||
        [unread_ops, "process_visible"],
 | 
			
		||||
        [hashchange, "save_narrow"],
 | 
			
		||||
        [compose, "update_closed_compose_buttons_for_stream"],
 | 
			
		||||
        [compose_closed_ui, "update_reply_recipient_label"],
 | 
			
		||||
        [search, "update_button_visibility"],
 | 
			
		||||
        [compose_actions, "on_narrow"],
 | 
			
		||||
        [top_left_corner, "handle_narrow_activated"],
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user