from pathlib import Path ROOT=Path(__file__).resolve().parents[1] def test_version(): assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1" def test_simple_chat_hides_progress_until_needed(): js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") assert "function classifyChatProgress" in js assert 'return "simple"' in js assert "statusNeedsProgress" in js assert 'visible:complexity!=="simple"' in js assert "ensureLifecycleVisible" in js def test_data_status_can_reveal_progress_dynamically(): js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") assert "if(!lifecycle.visible&&statusNeedsProgress(st,E.d))" in js assert "批量任务已转入后台执行" in js def test_avatar_sync_status_is_visible_in_settings(): js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") assert "function avatarSyncLabel" in js assert "云端持久化同步" in js assert "临时服务器存储" in js assert 'id="avatarSyncStatus"' in js def test_avatar_still_server_synced(): py=(ROOT/"services"/"user_state.py").read_text(encoding="utf-8") assert '"userAvatar"' in py assert 'startswith("/data/")' in py