Dashboard polish

This commit is contained in:
2026-08-11 15:28:29 -04:00
parent f1d46e7ab8
commit 34cb9a5e3e
11 changed files with 150 additions and 76 deletions

View File

@@ -63,3 +63,21 @@ def test_every_card_links_somewhere(app):
if card['render'] == 'metric':
continue
assert (card.get('map') or {}).get('link'), card
def test_a_viewall_target_is_one_of_the_known_pages(app):
"""A card's overflow line links here. Pointing it at a route nobody wrote is
the same rot the endpoint check exists to stop - it just fails in the
browser instead of the API."""
known = {
'/pcs', '/machines', '/printers', '/network', '/notifications',
'/geenforce', '/reports/toner', '/reports/warranty',
'/reports/pc-relationships', '/reports/calibration', '/reports',
}
with app.app_context():
for pluginname, card in _declared(app):
target = card.get('viewall')
if target is None:
continue
assert target in known, '{}: {} is not a known page'.format(
pluginname, target)