Raxol.Test.AssertionHelpers (Raxol v0.3.0)

View Source

Common assertion helpers for Raxol tests. Provides standardized assertions for components, events, and state.

Summary

Functions

Asserts that a component properly handles errors.

Asserts that a component received an event.

Asserts that a component's render output matches a snapshot.

Asserts that a component's render output matches expected text.

Asserts that a component is responsive across different sizes.

Asserts that a component's state matches expected values.

Asserts that a component maintains consistent styling across themes.

Asserts that a component did not receive an event.

Functions

assert_error_handled(component, error_fn)

Asserts that a component properly handles errors.

assert_event_received(event_name, timeout \\ 1000)

Asserts that a component received an event.

assert_matches_snapshot(component, snapshot_name, context)

Asserts that a component's render output matches a snapshot.

assert_renders_with(component, expected_text)

Asserts that a component's render output matches expected text.

assert_responsive(component, sizes)

Asserts that a component is responsive across different sizes.

assert_state_match(component, expected)

Asserts that a component's state matches expected values.

assert_theme_consistent(component, themes)

Asserts that a component maintains consistent styling across themes.

refute_event_received(event_name, timeout \\ 1000)

Asserts that a component did not receive an event.