-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Describe the Feature
toHaveDisplayValue
is a Jest DOM matcher that asserts the value visible to the user in text inputs.
Adapting it to our case it would assert the value in TextInput
host elements, to match given value.
Possible Implementations
Proposed API:
export function toHaveDisplayValue(
this: jest.MatcherContext,
element: ReactTestInstance,
valueToMatch: TextMatch,
options?: TextMatchOptions
)
The matcher should:
- Validate that it is invoked on host TextInput element
- Get the current value as
props.value ?? props.defaultValue
- Compare it with passed
valueToMatch
.
Each matcher should have a fairly comprehensive test suite.
Links
toHaveDisplayValue
matcher code from Jest DOM: https://github.com/testing-library/jest-dom/blob/main/src/to-have-display-value.js
Related Issues
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed