KonnorRogers / shadow-dom-testing-library

An extension of DOM-testing-library to provide hooks into the shadow dom
MIT License
98 stars 2 forks source link

This package is exactly what I'm looking for! #6

Closed ThijSlim closed 2 years ago

ThijSlim commented 2 years ago

Hi! The previous package testing-library__dom stopped working while migrating from Jest to Vitest. Also it is not maintained for the last 2 years. Your package works out of the box when including getByShadowRole.

Something I was missing in the previous package is that when a specific role is not found there was no representation of the DOM like and the available roles inside the (shadow)DOM.

<div>
 <web-component>
 #shadowroot
 <button>Text</button>
</webcomponent>
<div> 

The only thing it showed was:

<div>
 <web-component>
 Text
</webcomponent>
<div> 

This to improve developer experience.

Anyways, nice to finally have a package which supports Shadow DOM!