Skip to main content

Module testing

Module testing 

Source
Expand description

Reusable assertions for widget registry conformance tests.

Registry tests wire these probes into their real components, drive the component through its normal interaction path, then call the corresponding assertion. The probes deliberately do not prescribe a rendered element or DOM event because those details belong to each widget.

§Conformance levels

The convention has two levels, and the kit certifies each:

Bindings that support Focus Exit can additionally use FocusExitProbe and FocusExitOrderProbe. These probes are optional: they do not add requirements to the dependency-free prop trio or to existing Commit-only field-aware conformance. Widget-specific logical-scope detection and deduplication remain the registry’s responsibility.

§Example

The runnable interaction-probe adapter demonstrates how callbacks created during rendering reach a registry-owned driver. The complete conformance test exercises all six required tests and the optional Focus Exit tests against a minimal field-aware widget.

Structs§

ChangeOriginProbe
Records values written through a Binding together with their ChangeOrigin.
CommitOrderProbe
Records the relative order of a widget commit and its containing submit handler.
FocusExitOrderProbe
Records the relative order of binding writes, Commits, and Focus Exits.
FocusExitProbe
Records reports that focus left a widget’s complete logical focus scope.
FocusRoundTripProbe
Records focus callbacks reached through a widget’s resolved crate::FocusRequest.
OverridableMetaFlags
The independently overridable metadata flags required by the convention.

Functions§

assert_binding_resolution_precedence
Asserts explicit binding, context binding, then internal-state resolution precedence.
assert_field_part_ids
Asserts the description and error ids currently registered in field metadata.
assert_meta_flag_precedence
Asserts the invalid and disabled flags observed after applying explicit per-flag props.
assert_meta_resolution_precedence
Asserts explicit metadata, context metadata, then standalone metadata resolution precedence.