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: check element type in different environments #552

Merged
merged 1 commit into from
Feb 1, 2021
Merged

Conversation

ph-fritsche
Copy link
Member

Add a helper to verify the element type in different environments.

What:

Add a helper to utils.
This can be removed from this library and replaced by a shared helper in @testing-library/dom once it is bumped to a version that includes testing-library/dom-testing-library#885.

Why:

See #550

How:

The helper tries to find the element constructor on the window.

As the window is neither required to be associated with the observed document nor is it required to provide any element constructors, the helper provides a fallback for other environments than Jest+JSDOM.

Checklist:

  • N/A Documentation
  • Tests
  • N/A Typings
  • Ready to be merged

@codecov
Copy link

codecov bot commented Jan 31, 2021

Codecov Report

Merging #552 (45dd7cd) into master (390013e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #552   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          684       692    +8     
  Branches       214       216    +2     
=========================================
+ Hits           684       692    +8     
Impacted Files Coverage Δ
src/select-options.js 100.00% <100.00%> (ø)
src/utils.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 390013e...42904d1. Read the comment docs.

@kentcdodds
Copy link
Member

I think I'd prefer to merge the one in DOM, and then just bump the peerDep here, but either way this looks fine to me 👍 thanks!

@ph-fritsche
Copy link
Member Author

@kentcdodds testing-library/dom-testing-library#885 is closed so I guess we should merge this one.

@kentcdodds
Copy link
Member

Sounds good to me 👍

Copy link
Member

@kentcdodds kentcdodds 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 to me 👍

@kentcdodds kentcdodds merged commit b4330c4 into master Feb 1, 2021
@kentcdodds kentcdodds deleted the fix-550 branch February 1, 2021 21:01
@github-actions
Copy link

github-actions bot commented Feb 1, 2021

🎉 This PR is included in version 12.6.3 🎉

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.

2 participants