Testing
Simulating interactions
Tap buttons, flip toggles, and type into fields.
Result types carry enough state to simulate common interactions. Every interaction triggers a re-render of the tree so subsequent queries see the new state.
Click a button
Click calls the handler attached to the button and then rerenders.
Toggle a checkbox
Toggle flips the current checked value and invokes the OnChange
handler.
Type into a text field
Type updates the bound *StateValue[string] and rerenders. Submit
rerenders without changing the value; it is a hook for triggering an
OnSubmit-style interaction in components that observe the state.
Rerender manually
Rerender forces a render pass. Useful when state is mutated by code
outside the tree:
Most of the time the Click, Toggle, and Type methods handle this for
you.