Private
Public Access
0
0
Files
manual_slop/tests/test_selectable_ui.py
T
2026-05-16 15:59:40 -04:00

32 lines
1.1 KiB
Python

import pytest
import time
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from src.api_hook_client import ApiHookClient
import src.gui_2 as gui_2
@pytest.mark.integration
def test_selectable_label_stability(live_gui) -> None:
"""
Verifies that the application starts correctly with --enable-test-hooks
and that the selectable label infrastructure is present and stable.
"""
client = ApiHookClient()
assert client.wait_for_server(timeout=20), "Hook server failed to start"
diag = client.get_gui_diagnostics()
assert diag.get("prior") is False, "Initial state should not be viewing prior session"
assert hasattr(gui_2, 'render_selectable_label'), "gui_2 module must have render_selectable_label function"
client.set_value("ai_response", "Test selectable text stability")
time.sleep(1)
val = client.get_value("ai_response")
assert val == "Test selectable text stability", f"Expected 'Test selectable text stability', got '{val}'"
prior_val = client.get_value("prior_session_indicator")
assert prior_val is False, "prior_session_indicator field should be False initially"