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(suggestions): only warn about inaccessible elements when actually showing the suggestion #827

Merged
merged 1 commit into from
Nov 18, 2020

Conversation

benmonro
Copy link
Member

@benmonro benmonro commented Nov 17, 2020

What:
Console warnings are being emitted, even when they shouldn't be. For example, if you're using getByRole, you shouldn't see a warning about it, only when the suggestion is actually used.

Why:

causes noise in test runs.

How:
by moving the console.warn into the toString() which is only used when the suggestion is thrown.

Checklist:

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

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit dd60cdd:

Sandbox Source
react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Nov 17, 2020

Codecov Report

Merging #827 (dd60cdd) into master (7e5da11) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #827   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines          922       923    +1     
  Branches       281       282    +1     
=========================================
+ Hits           922       923    +1     
Impacted Files Coverage Δ
src/suggestions.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e5da11...dd60cdd. Read the comment docs.

@benmonro benmonro requested a review from maddijoyce November 17, 2020 23:14
Copy link
Member

@marcosvega91 marcosvega91 left a comment

Choose a reason for hiding this comment

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

Hi @benmonro, looks good to me :)

@kentcdodds kentcdodds merged commit 9494fdc into master Nov 18, 2020
@kentcdodds kentcdodds deleted the feature/only-warn-when-needed branch November 18, 2020 14:33
@github-actions
Copy link

🎉 This PR is included in version 7.27.1 🎉

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