thumbprint icon indicating copy to clipboard operation
thumbprint copied to clipboard

Change usage of `data-test` attribute to `data-testid`

Open danoc opened this issue 4 years ago • 1 comments

We should also rename the prop dataTest to dataTestId in the process.

I propose that we do this in a few steps:

  1. Add temporary support for both props and attributes.
  2. Either find and replace to perform the migration or create a codemod: https://github.com/thumbtack/thumbprint/tree/master/packages/thumbprint-codemods (We can likely borrow a lot from the other codemods.)
  3. Once the migration in website is complete, remove the deprecated prop. Release as a breaking change.

danoc avatar Sep 29 '20 20:09 danoc

We might not need to adjust the dataTest attribute https://testing-library.com/docs/dom-testing-library/api-helpers#custom-queries

For example, the code below shows a way to override the default testId queries to use a different data-attribute

https://testing-library.com/docs/react-testing-library/api#queries

mattybow avatar Oct 29 '20 01:10 mattybow