question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Would like to have some data-testid attributes on ui components of the datatable

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jdetlecommented, May 25, 2019

I got some work done on this, will be pushing it up on wednesday after I’m done giving a talk.

1reaction
gabrielliwerantcommented, May 14, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found