thumbtack/thumbprint

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

Opened this issue · 1 comments

danoc commented

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.

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