test: add comprehensive test coverage for hooks.ts#362
test: add comprehensive test coverage for hooks.ts#362its-me-abhishek merged 3 commits intoCCExtractor:mainfrom
Conversation
|
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:
More information on how to conduct a self review: 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! |
|
@its-me-abhishek The Frontend Test Coverage is failing due to the Reports Test File should I fix that in this PR ? |
|
sure |
|
@its-me-abhishek I feel lets make a diff PR for that #363 then merge this one |
|
Please rename the PR title and follow the commit conventions as set in CONTRIBUTING.MD while naming PRs and commits |
|
@its-me-abhishek Its done from my end now its perfect for merge |
Test Coverage Solution for hooks.ts
Issue Resolved
Added comprehensive test coverage for
frontend/src/components/HomeComponents/Tasks/hooks.tsTest Suite
What Was Done
fetchTaskwarriorTasks (4 tests)
addTaskToBackend (11 tests)
editTaskOnBackend (4 tests)
modifyTaskOnBackend (4 tests)
TasksDatabase (3 tests)
Impact on Overall Frontend Coverage
The hooks.ts file was the only file in the Tasks module with 0% coverage. This improvement brings it in line with other utilities:
Conclusion
The issue has been successfully resolved. The hooks.ts file now has comprehensive test coverage exceeding the 80% target with 100% statement, function, and line coverage, and 96.29% branch coverage.
Checklist
npx prettier --write .(for formatting)gofmt -w .(for Go backend)npm test(for JS/TS testing)