fix(gui): Resolve ImGui stack corruption, JSON serialization errors, and test regressions
This commit is contained in:
@@ -7,6 +7,7 @@ def test_file_item_fields():
|
||||
assert item.path == "src/models.py"
|
||||
assert item.auto_aggregate is True
|
||||
assert item.force_full is False
|
||||
assert item.injected_at is None
|
||||
|
||||
def test_file_item_to_dict():
|
||||
"""Test that FileItem can be serialized to a dict."""
|
||||
@@ -14,7 +15,8 @@ def test_file_item_to_dict():
|
||||
expected = {
|
||||
"path": "test.py",
|
||||
"auto_aggregate": False,
|
||||
"force_full": True
|
||||
"force_full": True,
|
||||
"injected_at": None
|
||||
}
|
||||
assert item.to_dict() == expected
|
||||
|
||||
@@ -23,12 +25,14 @@ def test_file_item_from_dict():
|
||||
data = {
|
||||
"path": "test.py",
|
||||
"auto_aggregate": False,
|
||||
"force_full": True
|
||||
"force_full": True,
|
||||
"injected_at": 123.456
|
||||
}
|
||||
item = FileItem.from_dict(data)
|
||||
assert item.path == "test.py"
|
||||
assert item.auto_aggregate is False
|
||||
assert item.force_full is True
|
||||
assert item.injected_at == 123.456
|
||||
|
||||
def test_file_item_from_dict_defaults():
|
||||
"""Test that FileItem.from_dict handles missing fields."""
|
||||
@@ -37,3 +41,4 @@ def test_file_item_from_dict_defaults():
|
||||
assert item.path == "test.py"
|
||||
assert item.auto_aggregate is True
|
||||
assert item.force_full is False
|
||||
assert item.injected_at is None
|
||||
|
||||
@@ -8,7 +8,8 @@ def test_render_discussion_panel_symbol_lookup(mock_app, role):
|
||||
with (
|
||||
patch('src.gui_2.imgui') as mock_imgui,
|
||||
patch('src.gui_2.mcp_client') as mock_mcp,
|
||||
patch('src.gui_2.project_manager') as mock_pm
|
||||
patch('src.gui_2.project_manager') as mock_pm,
|
||||
patch('src.markdown_helper.imgui_md') as mock_md
|
||||
):
|
||||
# Set up App instance state
|
||||
mock_app.perf_profiling_enabled = False
|
||||
|
||||
@@ -5,7 +5,7 @@ from src.gui_2 import App
|
||||
|
||||
|
||||
def _make_app(**kwargs):
|
||||
app = MagicMock(spec=App)
|
||||
app = MagicMock()
|
||||
app.mma_streams = kwargs.get("mma_streams", {})
|
||||
app.mma_tier_usage = kwargs.get("mma_tier_usage", {
|
||||
"Tier 1": {"input": 0, "output": 0, "model": "gemini-3.1-pro-preview"},
|
||||
@@ -13,6 +13,7 @@ def _make_app(**kwargs):
|
||||
"Tier 3": {"input": 0, "output": 0, "model": "gemini-2.5-flash-lite"},
|
||||
"Tier 4": {"input": 0, "output": 0, "model": "gemini-2.5-flash-lite"},
|
||||
})
|
||||
app.ui_focus_agent = kwargs.get("ui_focus_agent", None)
|
||||
app.tracks = kwargs.get("tracks", [])
|
||||
app.active_track = kwargs.get("active_track", None)
|
||||
app.active_tickets = kwargs.get("active_tickets", [])
|
||||
|
||||
Reference in New Issue
Block a user