Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huong-li-nguyen committed Apr 9, 2024
1 parent 5060a4d commit dec7037
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,19 @@ def test_non_default_nav_selector_pags_as_dict(self, pages_as_dict, built_nav_li
navigation = vm.Navigation(pages=pages_as_dict, nav_selector=vm.NavBar())
navigation.pre_build()
built_navigation = navigation.build(active_page_id="Page 1")
assert_component_equal(built_navigation["nav-bar"], dbc.Navbar(id="nav-bar"), keys_to_strip={"children"})
assert_component_equal(
built_navigation["nav-bar"], dbc.Navbar(id="nav-bar", className="flex-column"), keys_to_strip={"children"}
)
assert_component_equal(built_navigation["nav-panel"], dbc.Nav(id="nav-panel"), keys_to_strip={"children"})
assert_component_equal(built_navigation["nav-panel"].children, [dbc.Accordion()], keys_to_strip=STRIP_ALL)

def test_non_default_nav_selector_pages_as_list(self, pages_as_list):
navigation = vm.Navigation(pages=pages_as_list, nav_selector=vm.NavBar())
navigation.pre_build()
built_navigation = navigation.build(active_page_id="Page 1")
assert_component_equal(built_navigation["nav-bar"], dbc.Navbar(id="nav-bar"), keys_to_strip={"children"})
assert_component_equal(
built_navigation["nav-bar"], dbc.Navbar(id="nav-bar", className="flex-column"), keys_to_strip={"children"}
)
assert_component_equal(
built_navigation["nav-panel"],
dbc.Nav(id="nav-panel", className="d-none invisible"),
Expand Down

0 comments on commit dec7037

Please sign in to comment.