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

feat: Add extra error messages when screen was passed instead of a DOM element #949

Merged

Conversation

savcni01
Copy link
Contributor

@savcni01 savcni01 commented May 5, 2021

The PR is fix #911
When the user provides the wrong query (screen instead of a real query, we can output a clear, user-friendly error instead of general (and not relevant) - Create a new issue error.
Checklist:

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

 - first step for fix issue: Output User Error instead of New Issue error for wrong node from user
   getWindowFromNode(node) addresses issue testing-library#911
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 5, 2021

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 84aaba9:

Sandbox Source
react-testing-library-examples Configuration

…ror for wrong node from user

 - by adding additional check and correct error-message according to edge use case from the issue testing-library#911
@savcni01 savcni01 changed the title WIP: fix(error-messages): output clear User Error message instead of open New Issue Error mesage fix(error-messages): output clear User Error message instead of open New Issue Error message (fix #911) May 5, 2021
src/helpers.js Outdated Show resolved Hide resolved
savcni01 and others added 2 commits May 6, 2021 09:39
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
src/helpers.js Outdated Show resolved Hide resolved
src/helpers.js Outdated Show resolved Hide resolved
savcni01 and others added 3 commits May 9, 2021 08:50
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
src/helpers.js Outdated Show resolved Hide resolved
src/__tests__/helpers.js Outdated Show resolved Hide resolved
savcni01 and others added 3 commits May 10, 2021 09:49
Co-authored-by: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com>
Co-authored-by: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com>
@eps1lon eps1lon changed the title fix(error-messages): output clear User Error message instead of open New Issue Error message (fix #911) fix(error-messages): output clear User Error message instead of open New Issue Error message May 10, 2021
@codecov
Copy link

codecov bot commented May 10, 2021

Codecov Report

Merging #949 (84aaba9) into main (4b2976d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #949   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines          962       966    +4     
  Branches       290       293    +3     
=========================================
+ Hits           962       966    +4     
Flag Coverage Δ
node-10.14.2 100.00% <100.00%> (ø)
node-12 100.00% <100.00%> (ø)
node-14 100.00% <100.00%> (ø)
node-15 100.00% <100.00%> (ø)
node-16 100.00% <100.00%> (ø)

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

Impacted Files Coverage Δ
src/helpers.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 4b2976d...84aaba9. Read the comment docs.

@eps1lon eps1lon changed the title fix(error-messages): output clear User Error message instead of open New Issue Error message feat: Add extra error messages when screen was passed instead of a DOM element May 10, 2021
@eps1lon eps1lon merged commit c273ed5 into testing-library:main May 10, 2021
@eps1lon
Copy link
Member

eps1lon commented May 10, 2021

@savcni01 Thanks!

@github-actions
Copy link

🎉 This PR is included in version 7.31.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@savcni01 savcni01 deleted the feat/fix-user-err-instead-of-new-issue-err branch May 10, 2021 08:21
@savcni01
Copy link
Contributor Author

Thank you!

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.

"Please file an issue with the code that's causing you to see this error"
3 participants