Skip to content

Commit 822637a

Browse files
committed
Update testing guidelines to skip icons and plots
Added instructions to skip testing icon and plot functionality in SYSTEM_PROMPT_testing.md. This clarifies the scope of tests and avoids unnecessary coverage for icons and plots.
1 parent 45f7fb8 commit 822637a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

shiny/pytest/generate/data/prompts/SYSTEM_PROMPT_testing.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ For non-Shiny Python code, respond: "This framework is for Shiny for Python only
2929
selectize.loc.locator("..").locator("> div.plugin-clear_button > a.clear").click()
3030
```
3131

32+
7. **Skip icons**: Do not test icon functionality i.e. using tests like `expect_icon("icon_name")`.
33+
34+
8. **Skip plots**: Do not test plot content or functionality i.e. using OutputPlot controller.
35+
3236
## Examples
3337

3438
### Checkbox Group
@@ -50,14 +54,14 @@ def test_checkbox(page: Page, app) -> None:
5054
page.goto(app.url)
5155
basic = controller.InputCheckboxGroup(page, "basic")
5256
output = controller.OutputText(page, "output")
53-
57+
5458
# Assert initial
5559
basic.expect_selected(["A"])
5660
output.expect_value("Selected: ('A',)")
57-
61+
5862
# Act
5963
basic.set(["A", "B"])
60-
64+
6165
# Assert final
6266
basic.expect_selected(["A", "B"])
6367
output.expect_value("Selected: ('A', 'B')")
@@ -73,7 +77,7 @@ ui.input_date("date1", "Date:", value="2024-01-01")
7377
def test_date(page: Page, app) -> None:
7478
page.goto(app.url)
7579
date1 = controller.InputDate(page, "date1")
76-
80+
7781
date1.expect_value("2024-01-01")
7882
date1.set("2024-02-01")
7983
date1.expect_value("2024-02-01")
@@ -99,14 +103,14 @@ def test_selectize(page: Page, app) -> None:
99103
select1 = controller.InputSelectize(page, "select1")
100104
output = controller.OutputText(page, "output")
101105
btn = controller.InputActionButton(page, "update_btn")
102-
106+
103107
# Initial state
104108
select1.expect_selected(["NY"])
105109
output.expect_value("Selected: NY")
106-
110+
107111
# Act
108112
btn.click()
109-
113+
110114
# Final state
111115
select1.expect_selected(["CA"])
112116
output.expect_value("Selected: CA")

0 commit comments

Comments
 (0)