Skip to content

Conversation

@Neeraj-gagat
Copy link
Contributor

@Neeraj-gagat Neeraj-gagat commented Dec 27, 2025

Description

This PR adds unit and interaction tests for the NavbarMobile component

Added tests for following

  • Menu open/close behavior
  • Export tasks (JSON and TXT)
  • Auto-sync dialog rendering

these tests increaced coverage from 79% to 93%

- Fixes: #302

image

Screenshot from 2025-12-28 02-29-50

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

} from '../navbar-utils';

jest.mock('../navbar-utils', () => ({
jest.mock('@/components/utils/ExportTasks', () => ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mocked export fnc,s

expect(handleLogout).toHaveBeenCalled();
});

test('export task as json and close menu', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added test to ensure that export fnc calls and close menu for both json && txt
and added test to check the autosync renders in dialog

Copy link
Contributor Author

@Neeraj-gagat Neeraj-gagat left a comment

Choose a reason for hiding this comment

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

done with the self review nothing breaks and all tests passed
increased test coverage from 79 to 93%

@its-me-abhishek its-me-abhishek changed the title test:added test for NavbarMobile test: add test for NavbarMobile Dec 28, 2025
@its-me-abhishek its-me-abhishek merged commit 96af3f0 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