testing-playground
testing-playground copied to clipboard
Suggesting `getByText` over `getByLabelText`
Bug Report 🐛
Suggesting getByText over getByLabelText. As far as I understand, getByLabelText is of higher priority than getByText, according to https://testing-library.com/docs/queries/about/#priority
To Reproduce ✔️
Expected behavior 🤔
getByLabelText is suggested
Your Environment 💻
- browser: Chrome
- os: Mac
You're right. This must get fixed. Are you able to submit a pull?
This comes from @testing-library/dom. I believe it's because this function doesn't handle aria-label as a label. I'm not sure if it's a bug, or if it has a deeper accessibility reason, but the issue should be filed/fixed there.