NyStateTestHelpers class
Helpers for testing EventBus-driven state management in NyPage and NyState.
These utilities allow you to fire UpdateState events, trigger state actions, and assert on state data without needing to manually interact with the EventBus.
Quick Start
// Fire an update to a widget's state
fireStateUpdate('MyWidget', data: {'count': 1});
await tester.pump();
// Fire a state action
fireStateAction('MyWidget', 'refresh-page');
await tester.pump();
// Assert on state data
expectStateData(tester, find.byType(MyWidget), equals({'count': 1}));
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getActionsFor(
String stateName) → List< _FiredStateAction> -
Get all fired actions for a given
stateName. -
getUpdatesFor(
String stateName) → List< _FiredStateUpdate> -
Get all fired updates for a given
stateName. -
reset(
) → void - Reset all tracked state updates and actions.