Skip to content

Commit e914520

Browse files
Replace predicate functions with regex patterns for Playwright compatibility
Co-Authored-By: Alek Petuskey <[email protected]>
1 parent ba7a910 commit e914520

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

tests/test_chaining_event.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ def test_handler_from_handler(
3131
run_button.scroll_into_view_if_needed()
3232
expect(run_button).to_be_visible()
3333

34-
def is_at_least_value(value: str):
35-
try:
36-
return int(value) >= 10
37-
except ValueError:
38-
return False
39-
4034
run_button.click()
41-
expect(chain_heading).to_have_text(is_at_least_value)
35+
36+
expect(chain_heading).to_have_text(re.compile(r"10"))
4237

4338
expect(chain_heading).to_have_text("10")
4439

@@ -54,11 +49,8 @@ def test_collatz(reflex_web_app: AppHarness, page: Page, chaining_event_url):
5449
collatz_input = collatz_box.get_by_role("textbox")
5550
collatz_input.fill("10")
5651

57-
def is_expected_value(value: str):
58-
return value == "1"
59-
6052
collatz_input.blur()
6153

6254
collatz_heading = page.locator('[id="collatz"] > .rt-Flex > span')
6355

64-
expect(collatz_heading).to_have_text(is_expected_value)
56+
expect(collatz_heading).to_have_text(re.compile(r"1"))

0 commit comments

Comments
 (0)