Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support TextInput editable={false} prop check in isEnabled/isDisabled matchers #135

Conversation

HugoChollet
Copy link
Contributor

@HugoChollet HugoChollet commented Dec 8, 2022

What:

toBeDisabled and toBeEnabled matcher will now look at the editable prop from the TextInput component

Why:

TextInput does not have a disabled props but a editable to enable or disable it. The only way to test if it is truly disabled is through editable

How:

Added a supplementary check in isElementDisabled function

Checklist:

  • Documentation added to the docs
  • Typescript definitions updated (N/A)
  • Tests
  • Ready to be merged

README.md Outdated Show resolved Hide resolved
@HugoChollet HugoChollet force-pushed the feat/to-be-disabled-editable-prop branch from 42f9c49 to 0b3de92 Compare December 9, 2022 09:49
@HugoChollet HugoChollet marked this pull request as ready for review December 9, 2022 09:50
README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there :-)

@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Merging #135 (33e7b33) into main (d65e9f2) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #135   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines          224       227    +3     
  Branches        70        71    +1     
=========================================
+ Hits           224       227    +3     
Flag Coverage Δ
node-14 100.00% <100.00%> (ø)
node-16 100.00% <100.00%> (ø)
node-18 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/to-be-disabled.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need one more change, see comments for details

src/__tests__/to-be-disabled.tsx Outdated Show resolved Hide resolved
src/__tests__/to-be-disabled.tsx Show resolved Hide resolved
Copy link
Collaborator

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls check comments.

src/__tests__/to-be-disabled.tsx Outdated Show resolved Hide resolved
@HugoChollet HugoChollet force-pushed the feat/to-be-disabled-editable-prop branch from 140494c to efbfca6 Compare December 9, 2022 14:43
README.md Outdated Show resolved Hide resolved
src/to-be-disabled.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's 🚢 it!

@HugoChollet congratulation on your first PR to Jest Native! 👏

@mdjastrzebski mdjastrzebski changed the title feat: add editable prop to isDisabled matcher fix: support TextInput editable={false} prop check in isEnabled/isDisabled matchers Dec 9, 2022
@mdjastrzebski mdjastrzebski merged commit 4f74aa4 into testing-library:main Dec 9, 2022
@github-actions
Copy link

github-actions bot commented Dec 9, 2022

🎉 This PR is included in version 5.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants