@@ -26,7 +26,7 @@ def test_build_feedback_blocks():
2626
2727
2828def test_build_app_home_view_default ():
29- """Default args (app.py mode) — no OAuth section."""
29+ """Default args (app.py mode) — no MCP status section."""
3030 view = build_app_home_view ()
3131
3232 assert view ["type" ] == "home"
@@ -35,36 +35,31 @@ def test_build_app_home_view_default():
3535 actions_block = next (b for b in view ["blocks" ] if b ["type" ] == "actions" )
3636 assert len (actions_block ["elements" ]) == len (CATEGORIES )
3737
38- # No connect or disconnect buttons
39- section_blocks = [b for b in view ["blocks" ] if b ["type" ] == "section" ]
40- accessory_actions = [
41- b ["accessory" ]["action_id" ] for b in section_blocks if "accessory" in b
38+ # No MCP status section
39+ section_texts = [
40+ b ["text" ]["text" ] for b in view ["blocks" ] if b ["type" ] == "section"
4241 ]
43- assert "connect_account" not in accessory_actions
44- assert "disconnect_account" not in accessory_actions
42+ assert not any ("Slack MCP Server" in t for t in section_texts )
4543
4644
4745def test_build_app_home_view_connect ():
48- """authorize_url provided — shows Connect URL button ."""
49- view = build_app_home_view (authorize_url = "https://example.com/oauth " )
46+ """install_url provided — shows disconnected status with install link ."""
47+ view = build_app_home_view (install_url = "https://example.com/slack/install " )
5048
51- section_blocks = [b for b in view ["blocks" ] if b ["type" ] == "section" ]
52- connect_section = next (
53- b
54- for b in section_blocks
55- if b .get ("accessory" , {}).get ("action_id" ) == "connect_account"
56- )
57- assert connect_section ["accessory" ]["url" ] == "https://example.com/oauth"
49+ section_texts = [
50+ b ["text" ]["text" ] for b in view ["blocks" ] if b ["type" ] == "section"
51+ ]
52+ mcp_section = next (t for t in section_texts if "Slack MCP Server" in t )
53+ assert "disconnected" in mcp_section
54+ assert "https://example.com/slack/install" in mcp_section
5855
5956
60- def test_build_app_home_view_disconnect ():
61- """is_connected=True — shows Disconnect button ."""
57+ def test_build_app_home_view_connected ():
58+ """is_connected=True — shows connected status ."""
6259 view = build_app_home_view (is_connected = True )
6360
64- section_blocks = [b for b in view ["blocks" ] if b ["type" ] == "section" ]
65- disconnect_section = next (
66- b
67- for b in section_blocks
68- if b .get ("accessory" , {}).get ("action_id" ) == "disconnect_account"
69- )
70- assert disconnect_section ["accessory" ]["style" ] == "danger"
61+ section_texts = [
62+ b ["text" ]["text" ] for b in view ["blocks" ] if b ["type" ] == "section"
63+ ]
64+ mcp_section = next (t for t in section_texts if "Slack MCP Server" in t )
65+ assert "connected" in mcp_section
0 commit comments