"""Runs the plain-node vision panel zoom test (tests/js/test_vision_zoom.js). Same thin pytest wrapper pattern as test_vision_rows_js.py: shells out to ``node`` and asserts the script's own exit code. Skips (does not fail) when node is not installed. Covers gitea:Adriano/TieMeasureFlow#115 #122 (dal #122 il test JS verifica che lo zoom non sia piu' nel componente). """ import shutil import subprocess from pathlib import Path import pytest FLASK_APP_DIR = Path(__file__).resolve().parent.parent JS_TEST = Path(__file__).resolve().parent / "js" / "test_vision_zoom.js" def test_vision_zoom_js_behaviour(): node = shutil.which("node") if not node: pytest.skip("node non installato: test JS dello zoom del pannello saltato") result = subprocess.run( [node, str(JS_TEST)], cwd=str(FLASK_APP_DIR), capture_output=True, text=True, timeout=30, ) assert result.returncode == 0, ( f"tests/js/test_vision_zoom.js fallito (exit {result.returncode})\n" f"stdout:\n{result.stdout}\nstderr:\n{result.stderr}" )