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

Migrate from enzyme to Testing library and upgrading to React 18 #20593

Closed
28 tasks done
vraja-pro opened this issue Aug 23, 2023 · 1 comment · Fixed by #20653
Closed
28 tasks done

Migrate from enzyme to Testing library and upgrading to React 18 #20593

vraja-pro opened this issue Aug 23, 2023 · 1 comment · Fixed by #20653
Assignees

Comments

@vraja-pro
Copy link
Contributor

vraja-pro commented Aug 23, 2023

We’re moving to React 18. WP 6.2 onwards is using that already.
So we are not developing and testing with the correct React version.

Moving to React 18 is not compatible with our tests. We’re going to remove Enzyme in favour of Testing Library: https://testing-library.com/

We’re going to create a feature branch. Where we will:

  • Upgrade to React 18
  • Remove Enzyme
  • Install Testing Library
  • Remove Enzyme tests we will no longer support (testing unused components)
  • Migrate the rest of the Enzyme tests (around 20)

Notes:

  • We're not using Testing Library in the @yoast/components package because we do not expect to add components to this package anymore.
  • We're ignoring the yoast-components package because that is in the process of being removed.

Packages tasks

Check this list for each package:

  • Update to React 18
  • If using Enzyme => replace with Testing Library
  • If react-test-render is being used => upgrade to version compatible with React 18

Packages, see tasks above

Tests to migrate

  1. component: tests
    vraja-pro
  2. component: tests
    vraja-pro
  3. component: tests
    vraja-pro
  4. component: tests
    vraja-pro
  5. component: tests
    pls78
  6. component: tests
    pls78
  7. component: tests
    thijsoo
  8. component: tests
    igorschoester
  9. component: tests
    igorschoester
  10. component: tests

Tests to remove

Final checklist

@vraja-pro
Copy link
Contributor Author

Got blocked with JS package and react testing library.
Also need to address components package, it might be related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants