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

dataTestId and dataTestPrefixId props are un-intuitive #587

Open
mkarajohn opened this issue Mar 15, 2023 · 0 comments
Open

dataTestId and dataTestPrefixId props are un-intuitive #587

mkarajohn opened this issue Mar 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mkarajohn
Copy link
Contributor

mkarajohn commented Mar 15, 2023

We should be able to just pass data-testid, which is the common convention (along with permutations data-testId, data-testID and data-testiD which are all valid attributes when using ...byTestId() in testing-library)

dataTestId is unintuitive and some components do not even expose it as an available prop (for example Button)

dataTestPrefixId is even worse, since the order of the words does not even make sense (it should be dataTestIdPrefix)

Since test-id prefixes are not a convention (so there is no reason to use something like data-testid-prefix) I simply sugggest we shorten the prop name to something like testIdPrefix (drop the data part so that one does not assume that since a dataTestIdPrefix exists a dataTestId exists as well)

@mkarajohn mkarajohn added the enhancement New feature or request label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant