feat: add history_overview_viz widget and enhance configuration handling
- Introduced the `history_overview_viz` widget to the dashboard, allowing users to visualize consolidated history data across various metrics. - Updated widget configuration to include `history_overview_viz` in the allowed widgets and added validation for its configuration. - Enhanced the widget catalog with details for the new `history_overview_viz` entry. - Implemented default values and validation logic for the widget's configuration, ensuring proper handling of user inputs. - Added tests to ensure proper validation of the `history_overview_viz` widget configuration. - Bumped application version to reflect the addition of the new widget.
This commit is contained in:
1 parent
e20b321b64
commit
97dbb0f80b
15 files changed
+1105
-727
No files matched your search
@@ -153,6 +153,41 @@ def test_recovery_history_viz_unknown_key():
|
||||
validate_widget_entry_config("recovery_history_viz", {"evil": True})
|
||||
|
||||
|
||||
def test_history_overview_viz_empty_expands_defaults():
|
||||
d = validate_widget_entry_config("history_overview_viz", {})
|
||||
assert d["chart_days"] == 30
|
||||
assert d["show_confidence_banner"] is True
|
||||
assert d["show_area_summaries"] is True
|
||||
assert d["show_correlation_c1_c3"] is True
|
||||
assert d["show_drivers_c4"] is True
|
||||
|
||||
|
||||
def test_history_overview_viz_chart_days_and_merge():
|
||||
d = validate_widget_entry_config("history_overview_viz", {"chart_days": 60})
|
||||
assert d["chart_days"] == 60
|
||||
assert d["show_intro_blurb"] is True
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config("history_overview_viz", {"chart_days": 5})
|
||||
|
||||
|
||||
def test_history_overview_viz_requires_visible_block():
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config(
|
||||
"history_overview_viz",
|
||||
{
|
||||
"show_confidence_banner": False,
|
||||
"show_area_summaries": False,
|
||||
"show_correlation_c1_c3": False,
|
||||
"show_drivers_c4": False,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def test_history_overview_viz_unknown_key():
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config("history_overview_viz", {"evil": True})
|
||||
|
||||
|
||||
def test_welcome_config_rejected_unknown_key():
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config("welcome", {"x": 1})
|
||||
|
||||
Reference in new issue
Block a user