hasProp function
Matcher
hasProp(
- dynamic propKey,
- dynamic propValue
Returns a matcher that matches Dart, JS composite, and DOM ReactElement
s and ReactComponent
s
that contain the prop pair (propKey
, propValue).
Since props of DOM ReactComponent
s cannot be read directly, the element's attributes are matched instead.
This matcher will always fail when unsupported prop keys are tested against a DOM ReactComponent
.
TODO: add support for prop keys that aren't the same as their attribute keys
Implementation
Matcher hasProp(dynamic propKey, dynamic propValue) => _HasPropMatcher(propKey, propValue);