Skip to content

Applying suggestion for table cell element query yields no results #334

Open
@ulisses-alves

Description

@ulisses-alves

Bug Report 🐛

Hi there
I have a simple table structure where I wanted to select its first cell. While applying a better selector suggested by the application, it no longer selects the element.

To Reproduce ✔️

  1. Enter the following HTML
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>E-mail</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>foo</td>
      <td>[email protected]</td>
    </tr>
  </tbody>
</table>
  1. Enter the following selector
screen.getByText('foo')
  1. The application then suggests
screen.getByRole('cell', { name: /foo/i })
  1. Apply the aforementioned suggestion
  2. No element is found

Expected behavior 🤔

The element <td>foo</td> should be selected

Your Environment 💻

  • browser: Firefox
  • os: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions