Raxol.Test.Integration (Raxol v0.3.0)
View SourceProvides utilities for testing component interactions and system integration.
This module focuses on testing:
- Multi-component interactions
- Event propagation between components
- State synchronization
- Terminal I/O simulation
- Component hierarchy behavior
Example
defmodule MyApp.IntegrationTest do
use ExUnit.Case
use Raxol.Test.Integration
test_scenario "parent-child communication", %{parent: Parent, child: Child} do
# Set up component hierarchy
{:ok, parent, child} = setup_component_hierarchy(Parent, Child)
# Simulate user interaction
simulate_user_action(parent, {:click, {10, 10}})
# Verify component interaction
assert_child_received(child, :parent_clicked)
assert_parent_updated(parent, :child_responded)
end
end
Summary
Functions
Verifies that a component properly handles a system event.
Simulates component mounting in the application.
Sets up a parent-child component hierarchy for testing.
Sets up a test scenario with multiple components.
Simulates a user action on a component.
Simulates component unmounting from the application.
Functions
Verifies that a component properly handles a system event.
Simulates component mounting in the application.
Sets up a parent-child component hierarchy for testing.
Returns the initialized parent and child components with proper event routing.
Sets up a test scenario with multiple components.
This function:
- Initializes all components
- Sets up event routing
- Configures component relationships
- Establishes test monitoring
Simulates a user action on a component.
Handles various types of user interactions and ensures proper event propagation.
Simulates component unmounting from the application.