-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
Description
@testing-library/domversion: 7.22.2- Testing Framework and version: Jest (whatever version comes with CodeSandbox)
- DOM Environment: whatever version comes with CodeSandbox
Relevant code or config:
import React from "react";
export default function App() {
return <button title="">OK</button>;
}What you did:
screen.getByRole("button", { name: /ok/i });What happened:
Unable to find an accessible element with the role "button" and name `/ok/i`
Here are the accessible roles:
button:
Name "":
<button
title=""
/>
Reproduction:
https://codesandbox.io/s/happy-chandrasekhar-311qt?file=/src/App.js
Problem description:
Chrome reports that the button has a name:
But getByRole says it does not.
JSFiddle: https://jsfiddle.net/91retmv2/
