Skip to content

Use jest-dom to get Web Awesome components? #80

Discussion options

You must be logged in to vote

Oh my. You have stumbled into a hornet's nest.

The TLDR is that Web Awesome utilizes the shadow DOM which assuming you're using @testing-library/dom or @testing-library/react etc, you're going to hit issues trying to grab the native elements in the shadow dom.

I actually have a package I made to address this issue here:

https://github.com/KonnorRogers/shadow-dom-testing-library

That extends the testing library queries to support shadow DOM.

Further reading if youre curious about DOM Testing Library and shadow dom and why I created the library:

testing-library/dom-testing-library#1188

testing-library/dom-testing-library#413

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@david-athena
Comment options

Answer selected by david-athena
Comment options

You must be logged in to vote
1 reply
@claviska
Comment options

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