webui: format uptime duration

This commit is contained in:
2026-06-08 12:28:17 -06:00
parent 8004ce86e1
commit 6acfa61ddb
2 changed files with 30 additions and 1 deletions
+12
View File
@@ -552,3 +552,15 @@ def test_embedded_webui_temp_config_uses_mobile_cards():
assert "Weather Badge" in body
assert "configrow tempConfigRow" not in body
assert "Address:" not in body
def test_embedded_webui_formats_uptime():
source = firmware_source()
assert "function formatUptime(totalSeconds)" in source
assert 'parts.push(days+"d")' in source
assert 'parts.push(hours+"h")' in source
assert 'parts.push(minutes+"m")' in source
assert 'parts.push(seconds+"s")' in source
assert 'formatUptime(s.uptime_seconds||0)' in source
assert '+" sec"' not in source