Skip to content

Improve Redux test utilities #2329

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

Merged
merged 4 commits into from
Aug 10, 2023
Merged

Conversation

lindapaiste
Copy link
Collaborator

Previously submitted as part of #2054

Allows for better testing of connected components.

Changes:

  • reduxRender uses the same configureStore function as the app itself, meaning that the test Redux store will have the same middleware. This is necessary in order dispatch thunk actions from tests.
  • The return value of reduxRender includes the store instance, as shown in the Redux docs. This means that tests can call store.dispatch() or store.getState(), although interacting with the document (end-to-end testing) should be preferred over interacting with Redux directly.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

@lindapaiste lindapaiste added the Area:Optimization Category for site performance optimization and management label Jul 28, 2023
@lindapaiste lindapaiste mentioned this pull request Aug 3, 2023
4 tasks
@raclim raclim merged commit 84defd9 into processing:develop Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Optimization Category for site performance optimization and management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants