Skip to content

Conversation

MatthiasKainer
Copy link

@MatthiasKainer MatthiasKainer commented Nov 16, 2021

Provides the ability to specify a different element query mechanism other than querySelector and querySelectorAll.

An example of the usage with Georgegriff/query-selector-shadow-dom looks like this:

import { querySelectorAllDeep, querySelectorDeep } from 'query-selector-shadow-dom'; configure({ queryElement: querySelectorDeep, queryAllElements: querySelectorAllDeep, }) 

After this line, a query will also drill into the shadow dom of elements on the page

Why:

In our project, we are using a design system build with web components
(via stenciljs), and different projects in different frameworks (lit,
react, vue) want to use this library. The corresponding pr can be found
here:
testing-library/dom-testing-library#1054

Provides the ability to specify a different element query mechanism other than querySelector and querySelectorAll. An example of the usage with Georgegriff/query-selector-shadow-dom looks like this: import { querySelectorAllDeep, querySelectorDeep } from 'query-selector-shadow-dom'; configure({ queryElement: querySelectorDeep, queryAllElements: querySelectorAllDeep, }) After this line, a query will also drill into the shadow dom of elements on the page Why: In our project, we are using a design system build with web components (via stenciljs), and different projects in different frameworks (lit, react, vue) want to use this library. The corresponding pr can be found here: testing-library/dom-testing-library#1054
Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven' taken a look at the implementation PR, but I left a few remarks on the wording.

MatthiasKainer and others added 2 commits November 23, 2021 12:48
Co-authored-by: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com>
Co-authored-by: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants