Skip to content

test: improve ThemeModeToggle coverage to 100%#316

Closed
Hell1213 wants to merge 1 commit intoCCExtractor:mainfrom
Hell1213:test-theme-toggle
Closed

test: improve ThemeModeToggle coverage to 100%#316
Hell1213 wants to merge 1 commit intoCCExtractor:mainfrom
Hell1213:test-theme-toggle

Conversation

@Hell1213
Copy link
Copy Markdown
Contributor

Improved test coverage for ThemeModeToggle component from 70% to 100% across all metrics. Added test suite with 9 test cases covering component rendering, accessibility, theme switching functionality, and proper mocking of Radix UI dropdown components.

Contributes: #299

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

Updated documentation, if needed
Additional Notes
Part of frontend utils testing plan. Focused on meaningful behavior testing rather than coverage-only tests. No functional changes to existing component code.

Screenshot
Screenshot from 2025-12-26 19-01-54

@github-actions
Copy link
Copy Markdown

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!

Copy link
Copy Markdown
Contributor Author

@Hell1213 Hell1213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added ThemeModeToggle test coverage with proper Radix UI mocking to achieve 100% coverage across statements, branches, functions, and lines.

@its-me-abhishek
Copy link
Copy Markdown
Collaborator

@Hell1213 Thanks for working on this but it got fixed by #313 recently, closing for now!

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