@testing-library/dom version: "9.3.4"
- Testing Framework and version:
"@testing-library/jest-dom": "^6.9.1"
"@testing-library/vue": "^8.1.0"
- DOM Environment:
"happy-dom": "^20.10.6"
but also reproducible on "jsdom": "^24.1.3"
What you did:
I was trying to write a wrapper for picking up form elements, and noticed a quite strange bug - no accessible role is attached to the <input type="password" /> HTML element. When logging the roles, the element is totally omitted.
What happened:
Wrote up a small reproduction case, please check it out. It should log roles for both inputs in the provided code example, but only the <input type="text" /> is printed to the console:
textbox:
Name "":
<input
data-attr="hello"
type="textbox"
/>
Reproduction:
reproduction: https://stackblitz.com/edit/dtl-template-qjgkn4zv?file=src%2Fmain.test.ts
when in repository, launch tests
Problem description:
It is unable to get <input type="password" /> elements by their role. Tried textbox and password text roles, but they don't work (when listing roles, it is marked as a generic)
Suggested solution:
When inspected the Accesibility tree on Firefox browser, the password field has a role of password text, which could be used to attach the correct role here too.
@testing-library/domversion: "9.3.4""@testing-library/jest-dom": "^6.9.1""@testing-library/vue": "^8.1.0""happy-dom": "^20.10.6"but also reproducible on
"jsdom": "^24.1.3"What you did:
I was trying to write a wrapper for picking up form elements, and noticed a quite strange bug - no accessible role is attached to the
<input type="password" />HTML element. When logging the roles, the element is totally omitted.What happened:
Wrote up a small reproduction case, please check it out. It should log roles for both inputs in the provided code example, but only the
<input type="text" />is printed to the console:Reproduction:
reproduction: https://stackblitz.com/edit/dtl-template-qjgkn4zv?file=src%2Fmain.test.ts
when in repository, launch tests
Problem description:
It is unable to get
<input type="password" />elements by their role. Triedtextboxandpassword textroles, but they don't work (when listing roles, it is marked as ageneric)Suggested solution:
When inspected the
Accesibility treeon Firefox browser, the password field has a role ofpassword text, which could be used to attach the correct role here too.