🎯 Summary
The project has solid unit test coverage for AIEngineImpl, EvaluateNotificationUseCase, ParseCommandUseCase, and ChatViewModel, but the HistoryViewModel currently has no unit tests. Add tests for its search/filter functionality.
📍 Where to Look
app/src/main/java/com/hush/app/ui/screens/history/HistoryViewModel.kt — The ViewModel to test
app/src/test/java/com/hush/app/ui/screens/chat/ChatViewModelTest.kt — Example of how ViewModels are tested in this project (use as a pattern reference)
✅ What to Do
- Create a new test file:
app/src/test/java/com/hush/app/ui/screens/history/HistoryViewModelTest.kt
- Write tests covering:
- Initial state has empty search query
- Setting a search query updates the filtered logs
- Search filters by app name, title, and text content
- Empty search query returns all logs
- Search is case-insensitive
- Mock the
HistoryRepository dependency (follow the pattern in ChatViewModelTest)
🧪 How to Verify
./gradlew testDebugUnitTest --tests "*.HistoryViewModelTest"
All tests should pass.
📚 Resources
Great way to learn the project's architecture by writing tests for it! 🙌
🎯 Summary
The project has solid unit test coverage for
AIEngineImpl,EvaluateNotificationUseCase,ParseCommandUseCase, andChatViewModel, but theHistoryViewModelcurrently has no unit tests. Add tests for its search/filter functionality.📍 Where to Look
app/src/main/java/com/hush/app/ui/screens/history/HistoryViewModel.kt— The ViewModel to testapp/src/test/java/com/hush/app/ui/screens/chat/ChatViewModelTest.kt— Example of how ViewModels are tested in this project (use as a pattern reference)✅ What to Do
app/src/test/java/com/hush/app/ui/screens/history/HistoryViewModelTest.ktHistoryRepositorydependency (follow the pattern inChatViewModelTest)🧪 How to Verify
./gradlew testDebugUnitTest --tests "*.HistoryViewModelTest"All tests should pass.
📚 Resources
ChatViewModelTest.ktfor the project's testing conventionsGreat way to learn the project's architecture by writing tests for it! 🙌