KonnorRogers / shadow-dom-testing-library

An extension of DOM-testing-library to provide hooks into the shadow dom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Queries suggest replacements incorrectly

CreativeTechGuy opened this issue · comments

Currently the queryAllBy methods in this library have suggest = false so that Testing Library doesn't attempt to suggest better queries. It'd be nice if the suggestions could work with this library but that's another issue. The current issue is that all of the other queries (getBy, getAllBy, queryBy, findBy, findAllBy) still will suggest incorrectly when used.

It seems like this is because buildQueries will wrap the shadow queries like this which results in a check for suggestions before your method sets it to false.

It seems like a solution would be to wrap every query similar to how you are doing it here.

Closed by #29