fix(tests): Resolve access violation in phase4 tests and auto-approval logic in cli integration tests

This commit is contained in:
2026-03-03 01:35:37 -05:00
parent 6b2270f811
commit 5401fc770b
3 changed files with 9 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ def test_gemini_cli_full_integration(live_gui: Any) -> None:
client.click("btn_reset")
time.sleep(1.5)
client.set_value("auto_add_history", True)
client.set_value("manual_approve", True)
# Switch to manual_slop project explicitly
client.select_list_item("proj_files", "manual_slop")
# 1. Setup paths and configure the GUI
@@ -81,6 +82,7 @@ def test_gemini_cli_rejection_and_history(live_gui: Any) -> None:
client.click("btn_reset")
time.sleep(1.5)
client.set_value("auto_add_history", True)
client.set_value("manual_approve", True)
client.select_list_item("proj_files", "manual_slop")
mock_script = os.path.abspath("tests/mock_gemini_cli.py")
cli_cmd = f'"{sys.executable}" "{mock_script}"'

View File

@@ -40,6 +40,7 @@ def test_add_ticket_logic(mock_app: App):
mock_imgui.button.side_effect = button_side_effect
# Mock other necessary imgui calls to avoid errors
mock_imgui.begin_child.return_value = True
mock_imgui.get_window_draw_list.return_value.add_rect_filled = MagicMock()
# We also need to mock _push_mma_state_update
with patch.object(mock_app, '_push_mma_state_update') as mock_push:
@@ -76,6 +77,7 @@ def test_delete_ticket_logic(mock_app: App):
return label == "Delete##T-001"
mock_imgui.button.side_effect = button_side_effect
mock_imgui.tree_node_ex.return_value = True
mock_imgui.get_window_draw_list.return_value.add_rect_filled = MagicMock()
with patch.object(mock_app, '_push_mma_state_update') as mock_push:
# Render T-001