Skip to content

Commit 4157551

Browse files
committed
Added string tests
1 parent 1a2e769 commit 4157551

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@
2525

2626

2727
def server(input: Inputs, output: Outputs, session: Session):
28+
29+
@reactive.effect
30+
def _():
31+
ui.insert_nav_panel(
32+
"tabs",
33+
"Stringy Panel",
34+
target="Foo",
35+
position="before",
36+
)
37+
ui.insert_nav_panel(
38+
"tabs",
39+
"Stringier Panel",
40+
target="s2",
41+
position="before",
42+
)
43+
2844
@reactive.effect()
2945
@reactive.event(input.add)
3046
def _():

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
def test_dynamic_navs(page: Page, local_app: ShinyAppProc) -> None:
1111
page.goto(local_app.url)
1212

13+
# String insertion as panels worked correctly
14+
expect(page.get_by_text("Stringy Panel")).to_be_visible()
15+
page.get_by_role("button", name="Menu", exact=True).click()
16+
expect(page.get_by_text("Stringier Panel")).to_be_visible()
17+
page.get_by_role("button", name="Menu", exact=True).click()
18+
1319
# Page begins with 2 tabs: "Hello" and "Foo" and a nav menu with 2 static items.
1420
navset_tab = controller.NavsetTab(page, "tabs")
1521

0 commit comments

Comments
 (0)