An accessible name is the programmatically determined text label that identifies an interface element to assistive technologies. It can remain correct even when the visual presentation changes, such as when a link contains an image with alt text. section 10.1
Use accessible names when testing elements according to how users interact with the interface:
- Query an element by semantic role, such as link, button, heading, image, or listitem, rather than by tag name, class, or another implementation attribute. section 10.1
- Pass the expected name to getByRole, for example getByRole("link", { name: "Blog" }). section 10.1
- Recognize that names may come from text, nested nodes, images, SVGs, or other complex HTML; the underlying algorithm is more complicated than this summary. section 10.1
