test_workbench_registry.py 621 B

12345678910111213141516
  1. import pytest
  2. def test_registry_contains_exactly_five_standard_widgets():
  3. from app.core.workbench.registry import WIDGET_REGISTRY
  4. assert set(WIDGET_REGISTRY) == {"pending_reviews", "order_status", "product_stats", "datasource_health", "n8n_executions"}
  5. def test_layout_rejects_unknown_widgets_and_sizes():
  6. from app.core.workbench.registry import validate_layout
  7. with pytest.raises(ValueError):
  8. validate_layout([{"id": "arbitrary_sql", "x": 0, "y": 0, "w": 2, "h": 2}])
  9. with pytest.raises(ValueError):
  10. validate_layout([{"id": "pending_reviews", "x": 0, "y": 0, "w": 99, "h": 2}])