Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Ability to give the table a name #3192

Closed
cjsilva-umich opened this issue Dec 12, 2022 · 1 comment
Closed

FR: Ability to give the table a name #3192

cjsilva-umich opened this issue Dec 12, 2022 · 1 comment
Labels
feature wontfix This will not be worked on

Comments

@cjsilva-umich
Copy link

cjsilva-umich commented Dec 12, 2022

Is your feature request related to a problem? Please describe.
I would like to be able to pass a name to the base <table> element for testing purposes. If the table appears conditionally (ie: my app may show an error message instead of the table if there's a network error or similar) it would be nice to be able to do a simple const materialTable = await screen.findByRole("table", { name: "my-cool-table" })
using react-testing-library/jest.

Currently, my only choice seems to be to check whether the string I pass for the title is there as the appropriate heading level:
const tableHeading = await screen.findByRole("heading", { level: 6, name: "My Cool Table" })

Would much prefer the former. Is there any way to assign that table name?

@stale
Copy link

stale bot commented Mar 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

@stale stale bot added the wontfix This will not be worked on label Mar 18, 2023
@stale stale bot closed this as completed Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant