Rename Metrics to Monitors and move it second

This commit is contained in:
2026-08-31 15:21:48 -04:00
parent b21503e250
commit f087a7a5b0
6 changed files with 29 additions and 24 deletions

View File

@@ -198,7 +198,7 @@ def test_a_group_nobody_defined_falls_back_rather_than_disappearing(
monkeypatch.setattr(plugin, 'get_asset_panels', lambda: [{
'id': 'typo', 'title': 'Typo', 'assettypes': ['*'],
'endpoint': '/api/whatever', 'render': 'keyvalue', 'position': 1,
'group': 'metrcis',
'group': 'montiors',
}])
assetid = _make_asset(db)
@@ -210,18 +210,18 @@ def test_a_group_nobody_defined_falls_back_rather_than_disappearing(
def test_group_matching_is_not_case_or_space_sensitive(app, client, db,
auth_headers, monkeypatch):
"""'Metrics ' is obviously meant to be metrics; do not send it to details."""
"""'Monitors ' is obviously meant to be monitors; do not send it to details."""
pm = app.extensions['plugin_manager']
monkeypatch.setattr(pm.registry, 'is_enabled', lambda name: True)
plugin = next(iter(pm.get_all_plugins().values()))
monkeypatch.setattr(plugin, 'get_asset_panels', lambda: [{
'id': 'shouty', 'title': 'Shouty', 'assettypes': ['*'],
'endpoint': '/api/whatever', 'render': 'keyvalue', 'position': 1,
'group': ' Metrics ',
'group': ' Monitors ',
}])
assetid = _make_asset(db)
panels = _data(client, '/api/pluginui/asset-panels?assetid=%d' % assetid,
auth_headers)
panel = next(p for p in panels if p['id'] == 'shouty')
assert panel['group'] == 'metrics'
assert panel['group'] == 'monitors'