Skip to content

Conversation

@ShivaGupta-14
Copy link
Contributor

@ShivaGupta-14 ShivaGupta-14 commented Dec 25, 2025

Description

Improved test coverage for the AddTaskDialog component. Previously, the component lacked proper test for newer fields like annotations, recurrence, and date pickers.

Changes:

  • Reorganize tests into logical describe blocks for better readability
  • Use test.each for Date Fields to eliminate repetitive test code
  • Add comprehensive tests for Annotations
  • Add tests for Recur field dropdown selection
  • Add tests for Project field create new / select existing flow
  • Cover edge cases: empty inputs, whitespace-only, duplicate prevention

Updates: #300

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

Additional Notes

Screenshots

  • Before:
    Screenshot 2025-12-25 at 1 56 12 PM
  • After:
    Screenshot 2025-12-25 at 7 44 44 PM

@github-actions
Copy link

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!

@ShivaGupta-14 ShivaGupta-14 force-pushed the test/300-add-addtaskdialog-tests branch 2 times, most recently from 08d027e to 0c748cc Compare December 25, 2025 08:49
@its-me-abhishek
Copy link
Collaborator

Line # 194 is untested as per the console, please fix/provide some context for future

@ShivaGupta-14
Copy link
Contributor Author

ShivaGupta-14 commented Dec 25, 2025

<SelectContent
  onWheel={(e) => e.stopPropagation()}  // Line 225
  className="max-h-60 overflow-y-auto"
>

As line 225 is a UX scroll prevention handler and as per guidelines mentioned in issue: 'focus should be on meaningful tests rather than coverage-only tests', I left this untested as it doesn't affect component behavior or state.

Also, Line 51 is a defensive check in getFilteredTasks(), but it's currently unreachable. Since the dropdown only appears when the search text is non-empty, this function never gets called with an empty search, so that condition is never hit.

Let me know what you prefer!

@ShivaGupta-14 ShivaGupta-14 force-pushed the test/300-add-addtaskdialog-tests branch from 0c748cc to 4935448 Compare December 25, 2025 13:43
- Reorganize tests into logical describe blocks for better readability
- Use test.each for Date Fields to eliminate repetitive test code
- Add comprehensive tests for Annotations
- Add tests for Recur field dropdown selection
- Add tests for Project field create new / select existing flow
- Cover edge cases: empty inputs, whitespace-only, duplicate prevention

Updates: CCExtractor#300
@ShivaGupta-14 ShivaGupta-14 force-pushed the test/300-add-addtaskdialog-tests branch from 4935448 to da3d5ec Compare December 25, 2025 14:16
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.

2 participants