"""Server-owned UI settings (no browser localStorage)."""

import os
import sys

PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SRC_PATH = os.path.join(PROJECT_ROOT, "src")
if SRC_PATH not in sys.path:
    sys.path.insert(0, SRC_PATH)

from util.audio_run_persist import read_audio_run_state  # noqa: E402
from util.sequence_playback import _sequence_switch_wait_from_settings  # noqa: E402


def test_audio_run_state_includes_device_form_fields():
    st = read_audio_run_state()
    assert "device_override" in st
    assert "device_select" in st


def test_sequence_switch_wait_from_settings():
    assert _sequence_switch_wait_from_settings() in ("beat", "downbeat")
