@@ -3737,6 +3737,21 @@ def test_bare_mixin_state() -> None:
37373737 assert ChildBareMixinState .get_root_state () == State
37383738
37393739
3740+ def test_mixin_event_handler_preserves_event_actions () -> None :
3741+ """Test that event_actions from @rx.event decorator are preserved when inherited from mixins."""
3742+
3743+ class EventActionsMixin (BaseState , mixin = True ):
3744+ @rx .event (prevent_default = True , stop_propagation = True )
3745+ def handle_with_actions (self ):
3746+ pass
3747+
3748+ class UsesEventActionsMixin (EventActionsMixin , State ):
3749+ pass
3750+
3751+ handler = UsesEventActionsMixin .handle_with_actions
3752+ assert handler .event_actions == {"preventDefault" : True , "stopPropagation" : True }
3753+
3754+
37403755def test_assignment_to_undeclared_vars ():
37413756 """Test that an attribute error is thrown when undeclared vars are set."""
37423757
@@ -4453,9 +4468,5 @@ async def test_rebind_mutable_proxy(mock_app: rx.App, token: str) -> None:
44534468 ) as state :
44544469 assert isinstance (state , MutableProxyState )
44554470 assert state .data ["a" ] == [2 , 3 ]
4456- if isinstance (mock_app .state_manager , StateManagerRedis ):
4457- # In redis mode, the object identity does not persist across async with self calls.
4458- assert state .data ["b" ] == [2 ]
4459- else :
4460- # In disk/memory mode, the fact that data["b"] was mutated via data["a"] persists.
4461- assert state .data ["b" ] == [2 , 3 ]
4471+ # Object identity persists across serialization, so data["b"] is also mutated.
4472+ assert state .data ["b" ] == [2 , 3 ]
0 commit comments