Would like to have some data-testid attributes on ui components of the datatable
See original GitHub issueHi, I have a mui-datatable that has some custom search functionality that I’d like to test. I’ve gotten really into the react-testing-library approach of actually testing the component, and am running into issues with being able to select different elements of the datatable. If you’d be okay with it, I’d like to submit a PR to add data-testid
props to key elements of the component.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
how to call async mock function with jest? - Stack Overflow
In this code there is some sections like renderCell , handleDelete , handleSelect , isRowSelectable={(params) => params.row.idx > 0} , and ...
Read more >Testing with react-testing-library and Jest | by Chidume Nnamdi
React-Testing-Library renders React components like a browser and we can select the ... OK, we have elements with data-testid attribute.
Read more >What is the data-testid attribute in testing? - Educative.io
data-testid is an attribute used to identify a DOM node for testing purposes. It should be used as a handler to the test...
Read more >DataTable UI widget documentation - Webix
Hello, Unfortunately, it isn't possible to enter another component directly into the cell. But datatable has properties: - subrows which can contain any...
Read more >Assertions | Cypress examples (v9.7.0) - Gleb Bahmutov
Sometimes an attribute can have a special character like . or : in it. ... assertions will not be shown as nicely in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I got some work done on this, will be pushing it up on wednesday after I’m done giving a talk.
You’re right, it looks like react native set the precedent for
data-testid
. Looking at that hurts my brain, but convention is convention! 😛Ok, I say go ahead with this, and lets see what you come up with as far as naming conventions for the actual ids.