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

Epic: Refactor Test Suite #4014

Open
13 of 16 tasks
drewbo opened this issue Dec 30, 2022 · 2 comments
Open
13 of 16 tasks

Epic: Refactor Test Suite #4014

drewbo opened this issue Dec 30, 2022 · 2 comments

Comments

@drewbo
Copy link
Contributor

drewbo commented Dec 30, 2022

As part of a broader React and related dependency upgrade, we likely need to significantly change our current test suite:

  • the primary test renderer enzyme does not have a supported adapter for React 18
  • the current React recommendation for test frameworks is to use jest and react-testing-library; these seemingly have better integration with newer React features than enzyme or mocha

Notes

Tasks

Preview Give feedback
  1. squad-pages
    apburnes
  2. squad-pages
    apburnes
  3. 2 of 2
    squad-pages
    drewbo
  4. squad-pages
    drewbo
  5. squad-pages
    drewbo
  6. squad-pages
    drewbo
  7. squad-pages
    apburnes sknep
  8. squad-pages
    apburnes sknep
  9. squad-pages
    sknep
  10. squad-pages
    sknep
  11. squad-pages
    apburnes sknep
  12. squad-pages
    drewbo
@drewbo
Copy link
Contributor Author

drewbo commented Aug 14, 2023

Started initial work on this in https://github.com/cloud-gov/pages-core/tree/refactor-test-suite and updated the acceptance criteria

@apburnes apburnes changed the title Refactor Test Suite Epic: Refactor Test Suite Apr 3, 2024
@apburnes apburnes added the epic label Apr 3, 2024
@drewbo
Copy link
Contributor Author

drewbo commented Jul 18, 2024

Update: I rebased the aforementioned branch and made a few updates to get linting + coverage working with latest main. The coverage stats show that this covers roughly 6% of the components and 4% of the whole frontend folder. An assortment of thoughts with no particular end goal:

  • Switching from enzyme to RTL (without making changes to the underlying test intent) is a bit of a chore but also maybe could be partially automated with some regex?
  • The non-component tests only need to be switched from chai to jest, which is mostly a matter of different assertion names. This is also a bit of a chore and maybe could be partially automated.
  • The test logic itself probably needs a once over. That seems like a big undertaking to do all at once, maybe it could happen in conjunction with component updates on some sort of ongoing basis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants