test: Improve coverage for MultiSelectFilter component
Description
Improved test coverage for the MultiSelectFilter component located in frontend/src/components/ui/multi-select.tsx. Comprehensive unit tests were added to verify rendering, user interactions, and state management, achieving 100% test coverage for this component.
- Fixes: #352
Checklist
- [x] Ran npx prettier --write . (for formatting)
- [x] Ran npm test (for JS/TS testing)
- [x] Added unit tests, if applicable
- [x] Verified all tests pass
- [ ] Updated documentation, if needed (N/A)
Additional Notes
The new test suite in frontend/src/components/ui/tests/multi-select-filter.test.tsx includes:
- Rendering Tests: Verified component renders correctly with titles, placeholders, custom icons, and varied className props.
- Interaction Tests:
- Opening and closing the popover using clicks and the Escape key.
- Selecting and deselecting multiple options.
- Clearing all selections via the "All" toggle.
- Search Logic: Validated case-insensitive filtering and the "No results found" state.
- Completion Stats: Confirmed that task completion metrics (count and percentage) display correctly when provided.
Coverage Results:
- Statements: 100%
- Branches: 100%
- Functions: 100%
- Lines: 100% hots, or context -->
Thank you for opening this PR!
Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.
Please take a moment to:
- Check the "Files changed" tab
- Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
- Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
- Finally, submit all the comments!
More information on how to conduct a self review: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request
This helps make the review process smoother and gives us a clearer understanding of your thought process.
Once you've added your self-review, we'll continue from our side. Thank you!