Raxol.Test.ButtonHelpers (Raxol v0.2.0)
View SourceHelper functions for testing button components.
This module provides specialized functions for:
- Button component setup
- Interaction testing
- Visual verification
- Style testing
Summary
Functions
Asserts that a child component received an event from parent.
Verifies that error handling works properly between components.
Asserts that a parent component was updated after a child event.
Verifies that state is synchronized between components.
Verifies that a component properly handles system events.
Captures the rendered output of a component.
Sets up a component hierarchy for testing parent-child interactions.
Sets up an isolated component for button testing.
Sets up a component for visual testing.
Simulates a user event on the button.
Simulates a user action on the button component.
Functions
Asserts that a child component received an event from parent.
Verifies that error handling works properly between components.
Asserts that a parent component was updated after a child event.
Verifies that state is synchronized between components.
Verifies that a component properly handles system events.
Captures the rendered output of a component.
Sets up a component hierarchy for testing parent-child interactions.
Parameters:
parent_module
: The parent component modulechild_module
: The child/button component module
Returns:
{:ok, parent, child}
with initialized components
Sets up an isolated component for button testing.
Parameters:
module
: The button component moduleprops
: Optional properties to initialize the button with
Returns:
{:ok, button}
with the initialized button component
Sets up a component for visual testing.
Simulates a user event on the button.
Parameters:
button
: The button componentevent
: The event to simulate (e.g., click, focus)
Returns:
- Updated button and any commands emitted
Simulates a user action on the button component.
Parameters:
button
: The button componentaction
: The action to simulate