Archived
Refactor UI assets and harden quality checks
This commit is contained in:
1 parent
23ab466c52
commit
4ecc8eb874
62 files changed
+3314
-3206
No files matched your search
@@ -0,0 +1,30 @@
|
||||
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/<secret>?myip=<ipaddr>",
|
||||
)
|
||||
setup = _setup_flow_section(
|
||||
create_demo="curl -sS 'https://karldns.example/api/v1/router/update/<secret>?myip=203.0.113.10'",
|
||||
create_demo_command="curl -sS 'https://karldns.example/api/v1/router/update/<secret>?myip=203.0.113.10'",
|
||||
)
|
||||
manual = _manual_updates_section(
|
||||
manual_demo="# explicit IPv4\ncurl -sS 'https://karldns.example/api/v1/router/update/<secret>?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
|
||||
Reference in new issue
Block a user