28 lines
1.4 KiB
Python
28 lines
1.4 KiB
Python
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
JS = (ROOT / "ui_builder" / "static" / "app.js").read_text(encoding="utf-8")
|
|
CSS = (ROOT / "ui_builder" / "static" / "styles.css").read_text(encoding="utf-8")
|
|
HTML = (ROOT / "ui_builder" / "static" / "index.html").read_text(encoding="utf-8")
|
|
SERVICE = (ROOT / "hockey_data" / "service.py").read_text(encoding="utf-8")
|
|
ROUTER = (ROOT / "hockey_data" / "router.py").read_text(encoding="utf-8")
|
|
MODULE_JS = (ROOT / "hockey_data" / "static" / "tournament-menu.js").read_text(encoding="utf-8")
|
|
|
|
def test_runtime_bell_controls_toasts_only():
|
|
assert "operatorToastsEnabled: true" in JS
|
|
assert "runtimeSession && !error && !force && state.operatorToastsEnabled === false" in JS
|
|
assert "Automatic triggers always remain active" in JS
|
|
assert "🔔 Toast: ВКЛ" in JS
|
|
assert "Toast-уведомления включены" in JS
|
|
assert "toasts_enabled" in SERVICE
|
|
assert '"triggers_enabled": True' in SERVICE
|
|
assert '@router.put("/preferences/toasts")' in ROUTER
|
|
assert "HOCKEY_RUNTIME_TOASTS_ENABLED" in JS
|
|
assert "HOCKEY_RUNTIME_TOASTS_ENABLED === false" in MODULE_JS
|
|
assert "🔔" in HTML
|
|
|
|
def test_runtime_can_grow_in_f11_and_large_viewports():
|
|
"""Main hockey canvas grows to 1.6, lines to 1.8, and both shrink uniformly."""
|
|
from tests.ui_contract_support import ui_contract
|
|
ui_contract("scale")
|