from karldns.web.html_utils import SafeHtml from karldns.web.sections.public_home import ( _manual_updates_section, _public_home_hero, _setup_flow_section, ) def test_public_home_sections_render_independently() -> None: hero = _public_home_hero( suffix="ddns.example.net", demo_update_url="https://karldns.example/api/v1/router/update/?myip=", ) setup = _setup_flow_section( create_demo="curl -sS 'https://karldns.example/api/v1/router/update/?myip=203.0.113.10'", create_demo_command="curl -sS 'https://karldns.example/api/v1/router/update/?myip=203.0.113.10'", ) manual = _manual_updates_section( manual_demo="# explicit IPv4\ncurl -sS 'https://karldns.example/api/v1/router/update/?myip=203.0.113.10'", ) assert isinstance(hero, SafeHtml) assert 'data-ui="hero-command"' in hero assert "ddns.example.net" in hero assert isinstance(setup, SafeHtml) assert "KarlDNS setup flow" in setup assert "Copy update example" in setup assert isinstance(manual, SafeHtml) assert 'id="manual-updates"' in manual assert "Copy manual update examples" in manual