Skip to content

Conversation

@Sparshagarwal29
Copy link
Contributor

@Sparshagarwal29 Sparshagarwal29 commented Dec 26, 2025

Description

This PR improves test coverage for the NavbarDesktop component.

I added a few focused tests that exercise real user interactions (opening the user menu, navigation links, GitHub link, and auto-sync UI) rather than relying on snapshot-only coverage.
A very small, non-functional tweak was made in NavbarDesktop to make these behaviors easier to test. No runtime behavior or logic was changed.

Checklist

  • Ran npx prettier --write . (handled via pre-commit hook)
  • Ran gofmt -w . (not applicable)
  • Ran npm test
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

This PR focuses on improving interaction-based test coverage for NavbarDesktop.
Some UI branches depend on third-party UI primitives and internal state transitions,
which are intentionally not over-mocked to keep tests maintainable and realistic.

Before
Screenshot 2025-12-26 215723

After
Screenshot 2025-12-26 215222

@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!

@its-me-abhishek
Copy link
Collaborator

Can it be further improved? @Sparshagarwal29

@Sparshagarwal29
Copy link
Contributor Author

Can it be further improved? @Sparshagarwal29

Thanks for the review.
Some remaining uncovered paths are tightly coupled to Radix Dialog/Dropdown behavior and async side effects (export/delete confirmation flows). Covering those reliably would likely require either refactoring the component to expose test seams or introducing heavier mocking, which I avoided in this PR to keep the tests stable and maintainable.

If you’d like, I can follow up with focusing on one of those flows (for example, delete confirmation or export actions), or refactor the component slightly to improve testability.

@its-me-abhishek
Copy link
Collaborator

Sure, please go ahead with more mocks as required. Though do make sure not to change the components' UI or functionality, and just test ids or aria labels, etc.

@Sparshagarwal29
Copy link
Contributor Author

Hey @its-me-abhishek I have improved the test by adding mock . Please take a look .

After more improvement

Screenshot 2025-12-28 005553

@its-me-abhishek its-me-abhishek changed the title Test/navbar desktop coverage test: navbar desktop coverage Dec 28, 2025
@its-me-abhishek its-me-abhishek merged commit eb89424 into CCExtractor:main Dec 28, 2025
4 checks passed
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 frontend test suites/cases for src/components/HomeComponents/Navbar

2 participants