webui: format uptime duration
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user