Matcher toBeDisabled does not take into account the editable prop of TextInput
HugoChollet opened this issue · 3 comments
HugoChollet commented
Problem / Feature Request
The matcher toBeDisabled
does not take into account the editable prop of the <TextInput />
component.
render(<TextInput testId="input" editable={false}/>)
expect(screen.getByTestId("input")).toBeDisabled() // will fail
In the readme.md, it says:
Check whether or not an element is disabled from a user perspective
In my opinion when we have <TextInput editable={false}/>
the element appears to be disabled from a user perspective
What do you think of adding the editable
prop into the checks of the matcher toBeDisabled
?
Environment
@testing-library/react-native version: 11.3.0
jest-preset: react-expo
react-native version: 0.69.6
node version: 18.11
MattAgn commented
Agreed, that would be a nice addition to have
mdjastrzebski commented
@HugoChollet Would you like to contribute a PR for this?
HugoChollet commented
close by #135