Private
Public Access
0
0

test: Fix assertions after GUI state unification

- Update test_gui_symbol_navigation.py and test_gui_text_viewer.py to assert against show_windows['Text Viewer'] instead of the deprecated show_text_viewer attribute.
- Increase synchronization wait time in test_visual_sim_gui_ux.py to ensure the GUI loop accurately reflects the mocked MMA status.
This commit is contained in:
2026-06-02 02:20:07 -04:00
parent 6e0d002d05
commit 964b5c5aa4
7 changed files with 240 additions and 29 deletions
+15 -3
View File
@@ -16,12 +16,11 @@ def test_text_viewer_state_update(live_gui) -> None:
content = "This is test content for the viewer."
text_type = "markdown"
client.push_event("custom_callback", {"callback": "_set_attr", "args": ["show_text_viewer", True]})
client.push_event("custom_callback", {"callback": "_set_attr", "args": ["text_viewer_title", label]})
client.push_event("custom_callback", {"callback": "_set_attr", "args": ["text_viewer_content", content]})
client.push_event("custom_callback", {"callback": "_set_attr", "args": ["text_viewer_type", text_type]})
# Poll for state change (up to 5s)
# Wait for text_type to settle
state = None
start_time = time.time()
while time.time() - start_time < 5:
@@ -30,7 +29,20 @@ def test_text_viewer_state_update(live_gui) -> None:
break
time.sleep(0.1)
# Now get current show_windows, update it, and set it back
current_windows = state.get('show_windows', {})
current_windows["Text Viewer"] = True
client.push_event("custom_callback", {"callback": "_set_attr", "args": ["show_windows", current_windows]})
# Poll for show_text_viewer compat flag
start_time = time.time()
while time.time() - start_time < 5:
state = client.get_gui_state()
if state and state.get('show_text_viewer') == True:
break
time.sleep(0.1)
assert state is not None
assert state.get('show_text_viewer') == True
assert state.get('show_text_viewer') == True # API hook still provides this for compat
assert state.get('text_viewer_title') == label
assert state.get('text_viewer_type') == text_type