26 lines
728 B
Python
26 lines
728 B
Python
"""Static checks for the Svrnty sidebar navigation injection."""
|
|
|
|
from pathlib import Path
|
|
|
|
NAV_JS = Path(__file__).resolve().parents[2] / "static" / "svrnty_nav.js"
|
|
|
|
|
|
def test_project_graph_is_not_in_left_nav():
|
|
src = NAV_JS.read_text()
|
|
assert "Project Graph" not in src
|
|
assert "/plugins/svrnty/umbrella.html" not in src
|
|
assert "window.open" not in src
|
|
|
|
|
|
def test_svrnty_tabs_participate_in_panel_switching():
|
|
src = NAV_JS.read_text()
|
|
assert "const TABS = [" in src
|
|
assert "const OUR_IDS = TABS.map((t) => t.id)" in src
|
|
assert 'id: "canvas"' in src
|
|
|
|
|
|
def test_canvas_tab_is_registered():
|
|
src = NAV_JS.read_text()
|
|
assert '{ id: "canvas"' in src
|
|
assert "svrnty-showing-\" + id" in src
|