Currently not all blueprint components propagate their data attributes to the rendered element and it would be great if they would, but for now we'd like to request data-* attributes on the Tab component.
We will can make more feature requests on other elements as we discover which ones are important. 馃槃
+1 in order to query Blueprint elements via getByTestId which uses the attribute data-testid.
+1 for this
It would be really nice to get this out. It's extremely helpful for integration tests to be able to store/access data-* attributes. Without it, I'm stuck with rather ugly hacks, like folding data into classes.
This was fixed for the Tab component in https://github.com/palantir/blueprint/pull/3766.
If there are other components where you need this feature, please list those out here.
I believe the Select<> component needs it as well.
I'd be open to a PR for this feature in <Select>, but it's not as simple as <Tab> because it's a more complicated component.
Can you show me an example of what you're doing in your test code? I'm potentially concerned that simply creating an easy selector for the wrapper element of a Select will not be sufficient for tests, and that you may end up reaching into the internals of the component, at which point you might as well use the exported class names:
import { Classes } from "@blueprintjs/select";
@adidahiya Please make it possible for <Alert> to have a data-testid as well, and it would be even better if we can assign data-testid for the cancel and confirm button in the <Alert> dialog.
@adidahiya I agree with @petejkim . Could it possible to send in a data-h (dataH) into <Alert> specifically for the Cancel and Confirm/[CUSTOM TEXT] buttons? Thank you!
Most helpful comment
+1 in order to query Blueprint elements via
getByTestIdwhich uses the attributedata-testid.