Show sub-components as indented rows in device list

This commit is contained in:
2026-06-10 12:40:13 -05:00
parent faeb8e8c04
commit 1309c2f5db
2 changed files with 54 additions and 6 deletions
+14 -3
View File
@@ -1116,13 +1116,24 @@ def _setup_parent_with_two_children(client):
}, follow_redirects=True)
def test_device_list_hides_subcomponents(client):
def test_device_list_nests_subcomponents(client):
_setup_parent_with_two_children(client)
resp = client.get("/device/")
assert resp.status_code == 200
assert b"Hub" in resp.data
assert b"Sensor A" not in resp.data
assert b"Sensor B" not in resp.data
# sub-components render as indented child rows under the parent
assert b"Sensor A" in resp.data
assert b"Sensor B" in resp.data
assert "".encode() in resp.data
# parent name is searchable on child rows
assert b'data-name="hub sensor a"' in resp.data
def test_assign_page_shows_parent_prefix(client):
_setup_rc_car(client)
resp = client.get("/battery/1/assign")
assert resp.status_code == 200
assert b"RC Car Set /" in resp.data
def test_subcomponent_type_location_null(client):