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

Jinda unit test teams #3095

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open

Conversation

jindaxz
Copy link

@jindaxz jindaxz commented Jan 29, 2025

Description

Added unit tests for the team.js action creators.

Related PRS (if any):

No related PRs.

Main changes explained:

  • Created a new test file teams.js.test.js under the appropriate directory.
    • The test suite includes:
      • Positive Test Cases:
        • setTeamDetail: Ensures the correct action is created with the provided data.
        • getUserTeamMembers: Ensures the correct endpoint is called and verifies that the correct action is dispatched with the fetched data.
        • getUserTeamMembers1: Similar validation as getUserTeamMembers, but for a different implementation.
        • getTeamDetail: Ensures the correct endpoint is called and verifies that the correct action is dispatched with the fetched data.
        • fetchAllManagingTeams: Ensures the correct endpoints are called and verifies that the correct actions are dispatched with the fetched data.
      • Error Handling:
        • Validates that errors are handled gracefully, ensuring no dispatch is made when the axios.get method fails with a 401 error.

How to test:

  1. Check out the current branch.
  2. Run npm install if necessary.
  3. Execute the following command: npm test teams.js.test.js
  4. Verify that all test cases pass successfully without any errors.

Screenshots or videos of changes:

image

Copy link

netlify bot commented Jan 29, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit f30fa2e
🔍 Latest deploy log https://app.netlify.com/sites/highestgoodnetwork-dev/deploys/6799e3e10151de0008c4696a
😎 Deploy Preview https://deploy-preview-3095--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@ziddigsm ziddigsm left a comment

Choose a reason for hiding this comment

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

The test cases pass successfully.

Screenshot 2025-01-29 at 2 52 43 PM

@fangedShadow
Copy link

All the test cases passed successfully
image_2025-01-29_153410327

Copy link

@saigirishpabbathi saigirishpabbathi left a comment

Choose a reason for hiding this comment

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

All tests are working as expected
image

Copy link

@sharansaim sharansaim left a comment

Choose a reason for hiding this comment

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

All the test cases passed successfully
3095 1

Copy link

@Srichand-Medagani Srichand-Medagani left a comment

Choose a reason for hiding this comment

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

All the test cases passes successfully without any errors. Everything looks fine!
Screenshot 2025-01-30 163116

@anirudhsk2107 anirudhsk2107 self-requested a review January 30, 2025 22:53
Copy link
Contributor

@anirudhsk2107 anirudhsk2107 left a comment

Choose a reason for hiding this comment

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

All test cases have passed
image

@beblicarl beblicarl self-requested a review January 31, 2025 12:51
Copy link

@linkhanthtel linkhanthtel left a comment

Choose a reason for hiding this comment

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

All test cases passed as expected! Nice work!

PR #3095

Copy link
Contributor

@Nahiyan-16 Nahiyan-16 left a comment

Choose a reason for hiding this comment

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

Hey Jinda, great job on this PR! The test coverage looks solid, and I appreciate the clear structure of the test cases. The mock implementations are well-placed, and the assertions effectively verify the expected behavior. One small suggestion would be to ensure consistent naming between getUserTeamMembers and getUserTeamMembers1 to improve clarity. Other than that, everything looks good!
Screenshot 2025-02-02 at 10 35 57 AM

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.

10 participants