Skip to content

Conversation

@Rustix69
Copy link
Contributor

@Rustix69 Rustix69 commented Jan 1, 2026

Test Coverage Solution for hooks.ts

Issue Resolved

Added comprehensive test coverage for frontend/src/components/HomeComponents/Tasks/hooks.ts

Test Suite

  • Total Tests: 26 tests

What Was Done

  1. fetchTaskwarriorTasks (4 tests)

  2. addTaskToBackend (11 tests)

  3. editTaskOnBackend (4 tests)

  4. modifyTaskOnBackend (4 tests)

  5. 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:

  • tasks-utils.ts: 93.5% coverage
  • report-download-utils.ts: 100% coverage
  • hooks.ts: 100% coverage (was 0%)

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

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

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!

@Rustix69
Copy link
Contributor Author

Rustix69 commented Jan 1, 2026

@its-me-abhishek The Frontend Test Coverage is failing due to the Reports Test File should I fix that in this PR ?

@its-me-abhishek
Copy link
Collaborator

sure

@Rustix69
Copy link
Contributor Author

Rustix69 commented Jan 1, 2026

@its-me-abhishek I feel lets make a diff PR for that #363 then merge this one

@its-me-abhishek
Copy link
Collaborator

Please rename the PR title and follow the commit conventions as set in CONTRIBUTING.MD while naming PRs and commits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Test Coverage for hooks.ts

2 participants