svrnty-hermes-webui-plugin/tests/unit/test_umbrella_inline_static.py
Svrnty c0ff59097c
Some checks failed
plugin-tests / test (push) Failing after 5s
upstream-drift / drift (push) Failing after 5s
Embed umbrella graph in workspace panel
2026-05-26 06:34:50 -04:00

55 lines
1.9 KiB
Python

"""Static checks for the inline Workspace-panel umbrella graph integration."""
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
INLINE_JS = ROOT / "static" / "umbrella_inline.js"
INLINE_CSS = ROOT / "static" / "umbrella_inline.css"
UMBRELLA_HTML = ROOT / "static" / "umbrella.html"
UMBRELLA_CSS = ROOT / "static" / "umbrella.css"
PLUGIN = ROOT / "plugin.py"
def test_plugin_injects_inline_umbrella_assets():
src = PLUGIN.read_text()
assert "/plugins/{STATIC_PREFIX}/umbrella_inline.css" in src
assert "/plugins/{STATIC_PREFIX}/umbrella_inline.js" in src
def test_inline_graph_targets_workspace_right_panel():
src = INLINE_JS.read_text()
assert "btnSvrntyWorkspaceGraph" in src
assert '.rightpanel .panel-actions' in src
assert "Project graph" in src
assert "svrntyUmbrellaInlineSurface" in src
assert "/plugins/svrnty/umbrella.html?inline=1" in src
assert "window.open(" not in src
def test_inline_graph_uses_right_panel_mode_switching():
src = INLINE_JS.read_text()
assert "openWorkspaceGraph" in src
assert "closeWorkspaceGraph" in src
assert "openWorkspacePanel" in src
assert "expandPanelForGraph" in src
assert "restorePanelWidth" in src
assert 'panel.style.width = "500px"' in src
assert "btnClearPreview" in src
assert "stopImmediatePropagation" in src
def test_inline_graph_has_panel_surface_styles():
src = INLINE_CSS.read_text()
assert ".svrnty-umbrella-inline-surface" in src
assert '.svrnty-umbrella-inline-surface[data-open="true"]' in src
assert ".svrnty-umbrella-inline-frame" in src
def test_standalone_umbrella_supports_inline_mode():
html = UMBRELLA_HTML.read_text()
css = UMBRELLA_CSS.read_text()
assert 'get("inline") === "1"' in html
assert "umbrella-inline" in html
assert "body.umbrella-inline .umbrella-header" in css
assert "body.umbrella-inline .umbrella-footer" in css