A version of DOM Testing Library which supports operations within the shadow DOM.
You want to use Testing Library to test your web UI, but your UI uses Web Components, which may contain elements inaccessible via standard queries.
This library's API is identical to that of @testing-library/dom
. For API documentation, please visit the Testing Library documentation.
Current functionality is focused around ensuring standard get*/find* functionality is supported. If you find Testing Library features which are unsupported by this library, please file an issue!
As @testing-library/dom
is a dependency of Testing Library solutions, one way of adding shadow DOM query support to these libraries is to alias @testing-library/dom
within your build.
{
...
alias: {
'@testing-library/dom': '@d2l/testing-library-shadow-dom',
...
},
...
}