Raxol.Test.Integration.Assertions (Raxol v0.2.0)
View SourceProvides custom assertions for integration testing of Raxol components.
This module includes assertions for:
- Component interaction verification
- Event propagation validation
- State synchronization checking
- Command routing verification
- Component lifecycle testing
Summary
Functions
Asserts that a child component received an event from its parent.
Asserts that commands are properly routed between components.
Asserts that error boundaries contain component failures.
Asserts that events are properly propagated through the component hierarchy.
Asserts that components are properly connected in a hierarchy.
Asserts that a component properly handles mounting and unmounting.
Asserts that a parent component was updated in response to a child event.
Asserts that component state is synchronized after interactions.
Asserts that a component handles system events without corruption.
Functions
Asserts that a child component received an event from its parent.
Example
assert_child_received child, :parent_clicked
Asserts that commands are properly routed between components.
Example
assert_command_routing source, target, command
Asserts that error boundaries contain component failures.
Example
assert_error_contained parent, child, fn ->
simulate_user_action(child, :trigger_error)
end
Asserts that events are properly propagated through the component hierarchy.
Example
assert_event_propagation [parent, child1, child2], event, fn components ->
# Verify each component's response
end
Asserts that components are properly connected in a hierarchy.
Example
assert_hierarchy_valid parent, [child1, child2]
Asserts that a component properly handles mounting and unmounting.
Example
assert_lifecycle_handled component, fn comp ->
mount_component(comp)
# Test mounted state
unmount_component(comp)
# Test unmounted state
end
Asserts that a parent component was updated in response to a child event.
Example
assert_parent_updated parent, :child_responded
Asserts that component state is synchronized after interactions.
Example
assert_state_synchronized [comp1, comp2], fn states ->
Enum.all?(states, & &1.counter == 0)
end
Asserts that a component handles system events without corruption.
Example
assert_system_events_handled component, [:resize, :focus, :blur]