Skip to content

Commit 1a2e769

Browse files
committed
Clarified test comments
1 parent 79b0f67 commit 1a2e769

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tests/playwright/shiny/components/dynamic_navs/test_navs_dynamic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_dynamic_navs(page: Page, local_app: ShinyAppProc) -> None:
1919
controller.NavsetTab(page, "tabs").expect_nav_titles(
2020
["Hello", "Foo", "Foo-1", "Static1", "Static2"]
2121
)
22-
# Test Foo-1 tab is added
22+
# Check that Foo-1 tab is added
2323
navpanel = controller.NavPanel(page, "tabs", "Foo").loc.filter(has_text="Foo-1")
2424
expect(navpanel).to_have_text("Foo-1")
2525

@@ -67,6 +67,7 @@ def test_dynamic_navs(page: Page, local_app: ShinyAppProc) -> None:
6767

6868
page.get_by_role("button", name="Menu", exact=True).click()
6969

70+
# Expect static tabs to be visible
7071
navpanel3 = controller.NavPanel(page, "tabs", "s1").loc
7172
expect(navpanel3).to_be_visible()
7273

@@ -84,7 +85,8 @@ def test_dynamic_navs(page: Page, local_app: ShinyAppProc) -> None:
8485

8586
# Expect the Menu to be visible again
8687
expect(page.get_by_role("button", name="Menu", exact=True)).to_be_visible()
87-
# Click the Menu button to show the static menu
88+
89+
# Click the Menu button to show the static menu and expect the panels to be visible again
8890
page.get_by_role("button", name="Menu", exact=True).click()
8991
navpanel3 = controller.NavPanel(page, "tabs", "s1").loc
9092
expect(navpanel3).to_be_visible()

tests/playwright/shiny/components/express_navs/test_express_navs.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@
99
def 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

Comments
 (0)