from pathlib import Path import subprocess import pytest @pytest.mark.parametrize("case", [ "poll_scope_and_owner", "poll_ABA_generation", "details_and_enrich_scope", "cache_vs_enrichment", "snapshot_context_and_order", "cache_context_coalescing", "enrichment_after_newer_live_score", "restore_actual_tournament", "late_loaded_cache_after_enrichment", "finished_cached_restore", "cached_open_ABA", "provider_runtime_overlay", "provider_other_sources_and_editor", "score_authority_and_foreign_context", "score_snapshot_same_revision", "score_load_scope_and_ABA", "score_selected_event", "score_snapshot_fences_pending_read", "score_mapping_result", ]) def test_match_selection_frontend(case): root = Path(__file__).resolve().parents[1] result = subprocess.run( ["node", "tests/match_selection_frontend.cjs", case], cwd=root, capture_output=True, text=True, timeout=15, ) assert result.returncode == 0, result.stdout + result.stderr assert f"PASS match selection frontend: {case}" in result.stdout, result.stdout + result.stderr