-
Notifications
You must be signed in to change notification settings - Fork 96
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
test: begin the switch to RTL #945
base: staging
Are you sure you want to change the base?
Conversation
Tests should be resolved by #972 |
## High Level Overview of Change This PR fixes the `LedgersPage` tests so they stop failing intermittently/in some PRs (like #945). ### Context of Change The `LedgersPage` tests fail for me locally.  ### Type of Change - [x] Bug fix (non-breaking change which fixes an issue) - [x] Tests (You added tests for code that already exists, or your new feature included in this PR) ### TypeScript/Hooks Update N/A - too complicated, not worth doing here. ## Test Plan Tests pass locally now.
Opening this PR (finally) now that the testing issue has been resolved |
Resolving the build error is more easily done after #984 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR
High Level Overview of Change
This PR introduces the React Testing Library (RTL) to the Explorer's testing system, beginning the rollout of replacing Enzyme. It is a more modern testing library, and supports later versions of React.
Three test files are switched over to use RTL:
Account
,Currency
, andAmount
.Only tests are affected by this change.
Context of Change
This switch is necessary to upgrade to React v18 (#668), which has a lot of features that would clean up the codebase a lot. Enzyme stopped supporting React at v16, and even v17 support requires a hacky adapter.
This PR replaces #530 - merge commits got messy and complicated, and it was easier to re-apply all the changes to the updated codebase.
Type of Change
Codebase Modernization
Test Plan
Tests pass locally and in CI.
Future Tasks
There are a total of 149 test files - not all of them use enzyme, but most do. This PR switches 3 of them over to RTL, to provide a template. The rest of the enzyme tests still need to be switched over.
A script could likely be written to handle most of the migration.