Dashboard polish
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user