Raxol.Test.Visual.Assertions (Raxol v0.4.0)
View SourceProvides custom assertions for visual testing of Raxol components.
This module includes assertions for:
- Component rendering verification
- Layout validation
- Style checking
- Visual regression testing
- Terminal output comparison
Summary
Functions
Asserts that a component's borders and edges align properly.
Asserts that a component's rendered output matches the expected snapshot.
Asserts that a component renders with the expected content.
Asserts that a component renders correctly at different terminal sizes.
Asserts that a component's style matches the expected theme.
Asserts that a component renders consistently across different themes.
Functions
Asserts that a component's borders and edges align properly.
Example
assert_aligned component, :all
assert_aligned component, [:top, :left]
Asserts that a component's rendered output matches the expected snapshot.
Example
assert_matches_snapshot(component, "button_primary")
Asserts that a component renders with the expected content.
Example
assert_renders_with component, "Expected Content"
Asserts that a component renders correctly at different terminal sizes.
Example
assert_responsive component, [
{80, 24},
{40, 12},
{20, 6}
]
Asserts that a component's style matches the expected theme.
Example
assert_styled_with component, %{color: :blue, bold: true}
Asserts that a component renders consistently across different themes.
Example
assert_theme_consistent component, %{
light: light_theme,
dark: dark_theme
}