from tests.timer_contract_support import run_timer_contract, assert_current_build_contract from pathlib import Path ROOT = Path(__file__).resolve().parents[1] APP_JS = (ROOT / "ui_builder" / "static" / "app.js").read_text(encoding="utf-8") APP_PY = (ROOT / "app.py").read_text(encoding="utf-8") def helper_block(): start = APP_JS.index("function vmixCountdownSyncCommands") end = APP_JS.index("function buildShortcutRuntimeContext", start) return APP_JS[start:end] def test_pause_uses_pause_and_change_without_stop_reset(): """Current native timer contract, executed against production functions.""" run_timer_contract('pause_freezes') def test_start_uses_change_then_start_without_stop_or_set_duration(): """Current native timer contract, executed against production functions.""" run_timer_contract('first_start') run_timer_contract('resume_preserves_native') def test_set_only_changes_current_position_and_does_not_toggle_pause(): """Current native timer contract, executed against production functions.""" run_timer_contract('explicit_edit') def test_runtime_version(): assert_current_build_contract()