Files
PlantAI-dev/apps/web/af3_sandbox/tests/test_frontend_contract.py
T
2026-08-03 18:42:47 +08:00

26 lines
914 B
Python

from pathlib import Path
SANDBOX_DIR = Path(__file__).resolve().parents[1]
def test_page_uses_only_local_vue_and_molstar_assets():
html = (SANDBOX_DIR / "index.html").read_text(encoding="utf-8")
assert "/shared-static/cdn/vue.global.prod.js" in html
assert "/static/vendor/molstar/molstar.js" in html
assert "/static/vendor/molstar/molstar.css" in html
assert "http://" not in html
assert "https://" not in html
assert 'id="molstar-viewer"' in html
def test_viewer_defines_explicit_chain_colors_and_disposal():
source = (SANDBOX_DIR / "static" / "af3-viewer.js").read_text(encoding="utf-8")
assert "MVSData.createBuilder()" in source
assert "label_asym_id: 'A'" in source
assert "label_asym_id: 'B'" in source
assert "#0066cc" in source
assert "#f28e00" in source
assert "replaceExisting: true" in source
assert "viewer.plugin.dispose()" in source