test(dashboard): count Hosts header cells, not bare <th> tags (#5214)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
"""The dashboard starts from a curated layout, the duplicate widgets are gone,
|
"""The dashboard starts from a curated layout, the duplicate widgets are gone,
|
||||||
and the Overview says what each number counts (#5213)."""
|
and the Overview says what each number counts (#5213)."""
|
||||||
|
import re
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
|
|
||||||
@@ -127,7 +128,7 @@ async def test_the_hosts_widget_gives_a_verdict_and_load_against_cores(app):
|
|||||||
assert page.index("VDNT-Util01") < page.index("VDNT-Docker02")
|
assert page.index("VDNT-Util01") < page.index("VDNT-Docker02")
|
||||||
assert "16.8 / 8 cores" in page and "0.9 / 4 cores" in page
|
assert "16.8 / 8 cores" in page and "0.9 / 4 cores" in page
|
||||||
assert "agent last reported" in page
|
assert "agent last reported" in page
|
||||||
assert page.count("<th>") == 5 and ">ping<" not in page and "24h" not in page
|
assert len(re.findall(r"<th[ >]", page)) == 5 and ">ping<" not in page and "24h" not in page
|
||||||
assert not hex_colours(page), hex_colours(page)
|
assert not hex_colours(page), hex_colours(page)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user