31 lines
982 B
Python
31 lines
982 B
Python
"""Assert the brand-skin assets are present + wired (P3.B, minimal feature test)."""
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
STATIC = ROOT / "static"
|
|
|
|
|
|
def test_brand_css_present():
|
|
assert (STATIC / "app.css").is_file()
|
|
|
|
|
|
def test_brand_js_present():
|
|
assert (STATIC / "app.js").is_file()
|
|
|
|
|
|
def test_montserrat_fonts_present():
|
|
fonts = list((STATIC / "fonts").glob("montserrat-*.woff2"))
|
|
assert len(fonts) >= 4, f"expected ≥4 Montserrat weights, got {len(fonts)}"
|
|
|
|
|
|
def test_plugin_registers_static_and_injects_assets():
|
|
"""plugin.register() must call register_static + inject_stylesheet + inject_script."""
|
|
from unittest.mock import MagicMock
|
|
import plugin as plg
|
|
api = MagicMock()
|
|
api.logger.return_value = MagicMock()
|
|
plg.register(api)
|
|
api.register_static.assert_called()
|
|
api.inject_stylesheet.assert_any_call("/plugins/svrnty/app.css")
|
|
api.inject_script.assert_any_call("/plugins/svrnty/app.js")
|