diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 2a0d70154..62720f1c0 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -2082,10 +2082,6 @@ class TriggerState(rx.State): """Sample event handler.""" pass - def do_another_thing(self, value): - """Sample event handler with arg.""" - pass - @pytest.mark.parametrize( "component, output", @@ -2141,7 +2137,7 @@ class TriggerState(rx.State): rx.box( rx.text( "random text", - on_click=lambda val: TriggerState.do_another_thing(val), # type: ignore + on_blur=lambda: TriggerState.do_something, ), ), True, diff --git a/tests/test_app.py b/tests/test_app.py index 5709d93a9..536b88575 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1392,8 +1392,12 @@ def test_app_state_determination(): a4 = App() assert a4.state is None - # Referencing an event handler enables state. a4.add_page(rx.box(rx.button("Click", on_click=rx.console_log(""))), route="/") + assert a4.state is None + + a4.add_page( + rx.box(rx.button("Click", on_click=DynamicState.on_counter)), route="/page2" + ) assert a4.state is not None