/ tests / hermes_cli / test_dashboard_browser_safe_imports.py
test_dashboard_browser_safe_imports.py
 1  """Static dashboard tests for browser-safe @nous-research/ui imports."""
 2  from pathlib import Path
 3  
 4  
 5  WEB_SRC = Path(__file__).resolve().parents[2] / "web" / "src"
 6  
 7  
 8  def test_dashboard_does_not_import_nous_ui_root_barrel():
 9      offenders = []
10      for ext in ("*.tsx", "*.ts"):
11          for path in WEB_SRC.rglob(ext):
12              content = path.read_text(encoding="utf-8")
13              if 'from "@nous-research/ui"' in content or "from '@nous-research/ui'" in content:
14                  offenders.append(str(path.relative_to(WEB_SRC)))
15  
16      assert offenders == []