Skip to main content

Crate stratum_test

Crate stratum_test 

Source
Expand description

§stratum-test

Test utilities for NexusStratum components.

Provides assertion helpers and test harness utilities for verifying component render output, accessibility attributes, and state transitions.

§Usage

use stratum_test::*;
use stratum_core::aria::AriaRole;

let output = MyComponent::render(&props);
assert!(assert_aria_role(&output, AriaRole::Button));
assert!(assert_has_class(&output, "btn-primary"));

Functions§

assert_aria_role
Assert that a RenderOutput has the expected ARIA role.
assert_attr_value
Assert that a RenderOutput has an HTML attribute with the expected string value.
assert_has_attr
Assert that a RenderOutput has an HTML attribute with the given name.
assert_has_class
Assert that a RenderOutput contains the specified CSS class.
assert_has_data_attr
Assert that a RenderOutput has a data attribute with the given name.
assert_not_aria_hidden
Assert that a RenderOutput does not have the aria-hidden attribute set to "true", ensuring the element is visible to assistive technology.
assert_tag
Assert that the render output uses the expected HTML tag.