-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Passing of data-* Attributes as Props #1073
Comments
TabPanel is a helper component. Therefore, unfortunately, this is impossible for it. Best Regards, |
@mertsincan, could we reconsider this and reopen it? Not all components are behaving correctly regarding |
+1 on reopening this issue. Best testing practices often speak of selecting with data-* attributes. Maybe you guys should consider putting an emphasis on testability with primereact components (meaning - making testing with primereact easier; I am aware there are virtually infinite ways to test an app). |
+1 on reopening the issue for the same reasons mentionned in the comment above. |
@evanemh @hstevanoski can you check my Code Sandbox? https://codesandbox.io/s/primereact-test-forked-341os5?file=/src/index.js
Do you have specific examples of components that don't work? |
We use data-testids as part of our unit and Cypress testing strategy so we don't need to use classnames or other DOM structure dependent selectors. React, by default, is set up to pass on data-* attributes, but it appears some Prime React components don't allow this.
Current behavior
https://codesandbox.io/s/primereact-data-attributes-4fufc
In the above example, the button gets the
data-testid
, but the InputSwitch and TabPanels do not.Expected behavior
data-* attributes should be passed through to the container element (assuming the top level div) of the components, similar to how the Button already handles this.
The text was updated successfully, but these errors were encountered: