Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
huong-li-nguyen committed Dec 21, 2023
1 parent 5bc310d commit 0b8b399
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 4 additions & 2 deletions vizro-core/src/vizro/models/_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)

Expand Down
6 changes: 0 additions & 6 deletions vizro-core/tests/unit/vizro/models/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

0 comments on commit 0b8b399

Please sign in to comment.