Skip to content

Commit

Permalink
Add integration test with foreach in match
Browse files Browse the repository at this point in the history
  • Loading branch information
masenf committed Sep 5, 2024
1 parent 8155286 commit 86dd0cd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions integration/test_var_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,16 @@ def index():
int_var2=VarOperationState.int_var2,
id="memo_comp_nested",
),
# foreach in a match
rx.box(
rx.match(
VarOperationState.list3.length(),
(0, rx.text("No choices")),
(1, rx.text("One choice")),
rx.foreach(VarOperationState.list3, lambda choice: rx.text(choice)),
),
id="foreach_in_match",
),
)


Expand Down Expand Up @@ -784,6 +794,8 @@ def test_var_operations(driver, var_operations: AppHarness):
# rx.memo component with state
("memo_comp", "1210"),
("memo_comp_nested", "345"),
# foreach in a match
("foreach_in_match", "first\nsecond\nthird"),
]

for tag, expected in tests:
Expand Down

0 comments on commit 86dd0cd

Please sign in to comment.