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

Project: Ensure all vNext packages exclusively use @testing-library/react and/or react-test-renderer for their tests #20102

Closed
26 tasks done
khmakoto opened this issue Oct 4, 2021 · 3 comments

Comments

@khmakoto
Copy link
Member

khmakoto commented Oct 4, 2021

Project: Ensure all vNext packages exclusively use @testing-library/react and/or react-test-renderer for their tests

Problem

We have decided to use @testing-library/react and react-test-renderer as the bespoke testing libraries for vNext but they have not been enforced or checked until now. We need to make sure that this is indeed the case.

Solution

Review all vNext packages and ensure that @testing-library/react is being used as the testing library in our vNext packages:

  • react-accordion - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-aria - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-avatar - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-badge - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-button - react-button uses enzyme for parts of its testing #19941
  • react-card - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-checkbox - react-checkbox uses enzyme for parts of its testing #20239
  • react-divider - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-image - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-input - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-label - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-link - react-link uses enzyme for parts of its testing #19940
  • react-make-styles - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-menu - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-popover - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-portal - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-positioning - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-provider - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-shared-contexts - This package does not have any tests
  • react-slider - react-slider uses enzyme for parts of its testing #20246
  • react-switch - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-tabster - This package does not have any tests
  • react-text - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-theme - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-tooltip - Already exclusively using @testing-library/react and/or react-test-renderer
  • react-utilities - react-utilities uses enzyme for parts of its testing #20402

Stretch goal

Look into upgrading @testing-library/react now that we support TS 3.8+.

Risks (Rabbit holes)

N/A

Out of scope (No-gos)

N/A

@layershifter
Copy link
Member

Just wondering, what is wrong with react-test-renderer? It's an official React tooling that is always up to date, https://reactjs.org/docs/test-renderer.html.

I see the bigger problem that react-conformance uses Enzyme and is it's used in v9 components it means that Enzyme will still leak there.

@khmakoto
Copy link
Member Author

@layershifter I thought we were consolidating on using @testing-library/react for most scenarios and I have gotten some feedback about the use of react-test-renderer in some PRs. We can talk more about this on the tech sync tomorrow to decide what the correct path forward is and I can update this and close issues as necessary after we have had that discussion.

@khmakoto khmakoto changed the title Project: Ensure all vNext packages use @testing-library/react for their tests Project: Ensure all vNext packages exclusively use @testing-library/react and/or react-test-renderer for their tests Oct 20, 2021
@khmakoto
Copy link
Member Author

End of month retrospective

What was achieved?

A complete review was done and issues were opened for those packages that were using enzyme. Some of the issues have already been addressed in PR.

What did we miss?

The stretch goal for upgrading @testing-library/react was not done.

What went well?

This project was well-scoped and having the ability to track all progress in one place helped.

What could have gone better?

Sending PRs earlier so that we ensured they were merged by the end of the sprint.

What changed from initial expectations?

Initially thought that only @testing-library/react was supported but later determined after discussion in the tech sync that react-test-renderer was also supported so a second pass had to be done.

@microsoft microsoft locked as resolved and limited conversation to collaborators Nov 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants