diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index b331966d1..d80cc3766 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -2,7 +2,7 @@ import logging from functools import partial -from typing import TYPE_CHECKING, List, Literal, TypedDict, Any +from typing import TYPE_CHECKING, List, Literal, TypedDict import dash import dash_bootstrap_components as dbc @@ -14,6 +14,8 @@ except ImportError: # pragma: no cov from pydantic import Field, validator +from dash.development.base_component import Component + import vizro from vizro._constants import MODULE_PAGE_404, STATIC_URL_PREFIX from vizro.actions._action_loop._action_loop import ActionLoop @@ -28,7 +30,7 @@ logger = logging.getLogger(__name__) -def _all_hidden(components: List[Any]): +def _all_hidden(components: List[Component]): """Returns True if all components are either None and/or have hidden=True.""" return all(component is None or getattr(component, "hidden", False) for component in components) diff --git a/vizro-core/tests/unit/vizro/models/test_page.py b/vizro-core/tests/unit/vizro/models/test_page.py index 3757bc66b..cc0a5b556 100644 --- a/vizro-core/tests/unit/vizro/models/test_page.py +++ b/vizro-core/tests/unit/vizro/models/test_page.py @@ -152,9 +152,3 @@ def test_action_auto_generation_valid(self, standard_px_chart): # TODO: Add unit tests for private methods in page build -@pytest.mark.usefixtures("vizro_app") -def test_page_build_left_side_removed(standard_px_chart): - page = vm.Page(title="Single Page", components=[vm.Graph(id="scatter_chart", figure=standard_px_chart)]) - dashboard = vm.Dashboard(pages=[page]) - dashboard.pre_build() - assert "id='left-main'" not in str(page.build())