Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test cases warnings in src/views/tests/project.test.js #5979

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

HelNershingThapa
Copy link
Contributor

@HelNershingThapa HelNershingThapa commented Jul 12, 2023

Coming from #5964 (comment), this PR:

  • Fix warnings for tests in src/views/tests/project.test.js
  • Refactor src/views/tests/taskSelection.test.js to utilize the createComponentWithMemoryRouter function.

- Fixed warning in related to the usage of navigate() outside of a useEffect() hook. The warning was triggered when setting parameters only in the test case, not directly related to the navigate() function from react-router-dom. The issue specifically occurred when no parameters were passed while visiting the user projects page, resulting in the selection of a fallback filter for 'managed by me'.
- Refactored the test case for the 'Project Detail Page' to utilize the `createComponentWithMemoryRouter` function.
- Resolved the `Error: Not implemented: window.scrollTo` by assigning a Jest function to `window.scrollTo`.
@sonarcloud
Copy link

sonarcloud bot commented Jul 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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

Successfully merging this pull request may close these issues.

None yet

1 participant