48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
"""Static checks for the umbrella graph browser assets."""
|
|
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
HTML = ROOT / "static" / "umbrella.html"
|
|
JS = ROOT / "static" / "umbrella.js"
|
|
|
|
|
|
def test_umbrella_exposes_spine_org_and_mindmap_controls():
|
|
html = HTML.read_text()
|
|
assert 'data-view="spine"' in html
|
|
assert 'data-view="org"' in html
|
|
assert 'data-view="mindmap"' in html
|
|
assert 'id="disclosure"' in html
|
|
|
|
|
|
def test_umbrella_implements_semantic_preset_views():
|
|
js = JS.read_text()
|
|
html = HTML.read_text()
|
|
assert 'id="layerOverlay"' in html
|
|
assert "const SPINE_LAYERS" in js
|
|
assert "Governance / Protocols" in js
|
|
assert "function spineLayout" in js
|
|
assert "function spinePositions" in js
|
|
assert "function orgPositions" in js
|
|
assert "function mindmapPositions" in js
|
|
assert 'name: "preset"' in js
|
|
assert "positions: (node) => positions[node.id()] || node.position()" in js
|
|
assert "window.__svrntyUmbrella.view" in js
|
|
|
|
|
|
def test_umbrella_has_collision_reduction_rules():
|
|
js = JS.read_text()
|
|
assert "function _estimatedLabelWidth" in js
|
|
assert "function _wrapGroupRows" in js
|
|
assert "function applyLabelDensity" in js
|
|
assert "function renderLayerOverlay" in js
|
|
assert "function applyDefaultDisclosure" in js
|
|
assert 'new Set(["credential"])' in js
|
|
assert 'new Set(["knowledge"])' in js
|
|
assert "function toggleLayerDisclosure" in js
|
|
assert "function resetGraphEmphasis" in js
|
|
assert "function focusNode" in js
|
|
assert 'selector: "node.hover"' in js
|
|
assert 'cy.on("zoom", () => applyLabelDensity())' in js
|
|
assert "window.cy = cy" in js
|