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

refactor: use native Redux store in tests #1894

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andogq
Copy link
Contributor

@andogq andogq commented Mar 20, 2025

Done

Refactored tests to remove redux-mock-store which has been deprecated. The mock store had the following features which had to be addressed:

  • Listing dispatched actions: This was only used by a subset of tests, so a store created with createStore exported from testing/utils includes middleware that will capture all dispatched actions.
  • Reducers were not run: Stores would not deviate from their initial value regardless of any dispatched actions. Since a real store is now being used, some tests need to be updated to correctly handle state changes (most commonly, loading states).

@andogq andogq self-assigned this Mar 20, 2025
@webteam-app
Copy link

@andogq andogq force-pushed the refactor/redux-mock-store branch 2 times, most recently from 4eed369 to c3685d1 Compare March 21, 2025 03:37
@andogq andogq force-pushed the refactor/redux-mock-store branch from c3685d1 to aa51999 Compare March 21, 2025 04:15
Copy link

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 97.98% (🎯 95%) 14490 / 14788
🟢 Statements 97.98% (🎯 95%) 14490 / 14788
🟢 Functions 98.37% (🎯 95%) 604 / 614
🟢 Branches 92.27% (🎯 90%) 3032 / 3286
File CoverageNo changed files found.
Generated in workflow #257 for commit da61267 by the Vitest Coverage Report Action

@andogq andogq force-pushed the refactor/redux-mock-store branch from da61267 to 1af8668 Compare March 21, 2025 04:59
@andogq
Copy link
Contributor Author

andogq commented Mar 21, 2025

Waiting on #1897 to re-run tests with Node 22

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

Successfully merging this pull request may close these issues.

2 participants