This commit is contained in:
2026-05-12 18:45:06 -04:00
parent 5be6ef88f8
commit 345be18d55
4 changed files with 345 additions and 152 deletions
+1
View File
@@ -24,6 +24,7 @@ def mock_gui():
def test_discussion_tabs_rendered(mock_gui):
with patch('src.gui_2.imgui') as mock_imgui, \
patch('src.imgui_scopes.imgui', new=mock_imgui), \
patch('src.app_controller.AppController.active_project_root', new_callable=PropertyMock, return_value='.'):
# We expect a combo box for base discussion
+14 -4
View File
@@ -18,10 +18,11 @@ def test_render_mma_dashboard_progress():
mock_imgui.begin_combo.return_value = (False, "")
mock_imgui.selectable.return_value = (False, False)
mock_imgui.begin_table.return_value = True
mock_imgui.collapsing_header.return_value = False
mock_imgui.begin_tab_item.return_value = (True, True)
mock_imgui.collapsing_header.return_value = False
# Patch where it is actually used
with patch('src.gui_2.imgui', mock_imgui), \
patch('src.imgui_scopes.imgui', new=mock_imgui), \
patch('src.gui_2.cost_tracker.estimate_cost', return_value=0.0):
# Mock App instance - no spec because of delegation
@@ -58,8 +59,17 @@ def test_render_mma_dashboard_progress():
app._avg_ticket_time = 60
# Call the method
App._render_mma_dashboard(app)
# Dashboard now delegates to sub-methods, so we wire them up to execute their real logic on the mock instance.
app._render_mma_focus_selector.side_effect = lambda: App._render_mma_focus_selector(app)
app._render_mma_track_summary.side_effect = lambda: App._render_mma_track_summary(app)
app._render_mma_epic_planner.side_effect = lambda: App._render_mma_epic_planner(app)
app._render_mma_conductor_setup.side_effect = lambda: App._render_mma_conductor_setup(app)
app._render_mma_track_browser.side_effect = lambda: App._render_mma_track_browser(app)
app._render_mma_global_controls.side_effect = lambda: App._render_mma_global_controls(app)
app._render_mma_usage_section.side_effect = lambda: App._render_mma_usage_section(app)
app._render_mma_agent_streams.side_effect = lambda: App._render_mma_agent_streams(app)
App._render_mma_dashboard(app)
# Assertions
# 1 completed out of 4 tickets = 25.0% progress
# Update assertions: imgui.progress_bar is called with (0.25, (-1.0, 0.0), '25.0%')