You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into this on my own project, so I created a reproducable example (full repo here: https://github.com/agmcleod/solid-testing-library-bug). I generated the example repo with solid start, but the only changes i made were to create an example input component with a label.
When the test suite runs, the second example which uses the same findByLabelText call fails to find the element with the following error:
TestingLibraryElementError: Found a label with the text of: /label text/i, however the element associated with this label () is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a , you can use aria-label or aria-labelledby instead.
If I then comment out the first test case and run yarn test the second test case will then pass. Likewise if I uncomment the test case, and use an id on the label tag, and then update the input to use aria-labelledby both tests will pass. So this must be something with the for attribute usecase.
The text was updated successfully, but these errors were encountered:
Ran into this on my own project, so I created a reproducable example (full repo here: https://github.com/agmcleod/solid-testing-library-bug). I generated the example repo with solid start, but the only changes i made were to create an example input component with a label.
When the test suite runs, the second example which uses the same findByLabelText call fails to find the element with the following error:
If I then comment out the first test case and run
yarn test
the second test case will then pass. Likewise if I uncomment the test case, and use an id on the label tag, and then update the input to usearia-labelledby
both tests will pass. So this must be something with the for attribute usecase.The text was updated successfully, but these errors were encountered: