99def test_dynamic_navs (page : Page , local_app : ShinyAppProc ) -> None :
1010 page .goto (local_app .url )
1111
12- # Page begins with 2 tabs: "Hello " and "Foo" and a nav menu with 2 static items.
12+ # Page begins with 2 tabs: "Panel 1 " and "Panel 2"
1313 controller .NavsetTab (page , "foo-navset" ).expect_nav_titles (["Panel 1" , "Panel 2" ])
1414 controller .NavsetTab (page , "bar-navset" ).expect_nav_titles (["Panel 1" , "Panel 2" ])
1515
16- # Click hide-tab to hide the Foo tabs
16+ # Click hide-tab to hide Panel 2 in the foo navset
1717 hidetab = controller .InputActionButton (page , "foo-hideTab" )
1818 hidetab .click ()
1919
20- # Expect the Foo tabs to be hidden
20+ # Expect the Foo's Panel 2 to be hidden
2121 navpanel = controller .NavPanel (page , "foo-navset" , "Panel 2" ).loc
2222 expect (navpanel ).to_be_hidden ()
2323
24- # Expect the bar tabs to not be affected
24+ # Expect the bar Panel 2 tab to not be affected
2525 navpanel2 = controller .NavPanel (page , "bar-navset" , "Panel 2" ).loc
2626 expect (navpanel2 ).to_be_visible ()
2727
28- # Click show-tab to show the Foo tabs again
28+ # Click show-tab to show the foo Panel 2 tab again
2929 showtab = controller .InputActionButton (page , "foo-showTab" )
3030 showtab .click ()
3131
32- # Expect the Foo tabs to be visible again
32+ # Expect the Foo Panel 2 tab to be visible again as well as the bar Panel 2
3333 navpanel2 = controller .NavPanel (page , "foo-navset" , "Panel 2" ).loc
3434 expect (navpanel2 ).to_be_visible ()
3535 navpanel3 = controller .NavPanel (page , "bar-navset" , "Panel 2" ).loc
@@ -38,5 +38,7 @@ def test_dynamic_navs(page: Page, local_app: ShinyAppProc) -> None:
3838 # Click the remove button to remove the panel 2 in bar
3939 removeTab = controller .InputActionButton (page , "bar-deleteTabs" )
4040 removeTab .click ()
41+
42+ # Check that bar's Panel 2 is gone, but foo's Panel 2 is unaffected
4143 controller .NavsetTab (page , "bar-navset" ).expect_nav_titles (["Panel 1" ])
4244 controller .NavsetTab (page , "foo-navset" ).expect_nav_titles (["Panel 1" , "Panel 2" ])
0 commit comments