Skip to content

Aaryaneil - Unit Tests errorsReducer component#3002

Merged
one-community merged 1 commit into
developmentfrom
aaryaneil-Unit-Test-errorsReducer
Apr 3, 2025
Merged

Aaryaneil - Unit Tests errorsReducer component#3002
one-community merged 1 commit into
developmentfrom
aaryaneil-Unit-Test-errorsReducer

Conversation

@aaryaneil
Copy link
Copy Markdown
Contributor

Description

Unit test for src/reducers/errorsReducer.js

Main changes explained:

Added test cases for the following:

  1. should return the initial state when no action is passed
  2. should handle GET_ERRORS
  3. should handle CLEAR_ERRORS
  4. should return the current state for unknown action types

How to test:

  1. check into the current branch
  2. do npm install and npm test errorsReducer.test.js to run this PR locally

Screenshots or videos of changes:

Screenshot 2024-12-31 at 4 31 55 PM

@aaryaneil aaryaneil added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Dec 31, 2024
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 31, 2024

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit a3a07e9
🔍 Latest deploy log https://app.netlify.com/sites/highestgoodnetwork-dev/deploys/6774714faa0cb90008b07515
😎 Deploy Preview https://deploy-preview-3002--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
Copy Markdown
Contributor

@kobakvantrishvili kobakvantrishvili left a comment

Choose a reason for hiding this comment

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

works well.

image

Copy link
Copy Markdown

@ManasaViswanadhapalli ManasaViswanadhapalli left a comment

Choose a reason for hiding this comment

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

@aaryaneil Just a small correction in the Description code path
the actual path is src/reducers/tests/errorsReducer.test.js but in the Description src/reducers/errorsReducer.test.js
Can you please take a look at once..
Other than that I have reviewed this PR and It is displaying all the test cases.
Please find below the reference test image
image

@aaryaneil
Copy link
Copy Markdown
Contributor Author

@aaryaneil Just a small correction in the Description code path the actual path is src/reducers/tests/errorsReducer.test.js but in the Description src/reducers/errorsReducer.test.js Can you please take a look at once.. Other than that I have reviewed this PR and It is displaying all the test cases. Please find below the reference test image image

Hey @ManasaViswanadhapalli , in the description I am referring to the path of the file the unit tests are for and not the path of the unit tests.

@beblicarl beblicarl self-requested a review January 10, 2025 16:51
@beblicarl
Copy link
Copy Markdown
Contributor

All tests passed successfully and the code is great

image

Copy link
Copy Markdown
Contributor

@nikhilgiri0226 nikhilgiri0226 left a comment

Choose a reason for hiding this comment

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

I have reviewed this PR and all the test cases passed successfully

image

Copy link
Copy Markdown
Contributor

@srikanthpusthem srikanthpusthem left a comment

Choose a reason for hiding this comment

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

image test cases passed

Copy link
Copy Markdown

@nikhilpittala16 nikhilpittala16 left a comment

Choose a reason for hiding this comment

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

I have tested the PR and all the test cases have passed.
image

Copy link
Copy Markdown
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 tests have passed
Screen Shot 2025-01-17 at 7 51 25 PM
Screen Shot 2025-01-17 at 7 49 20 PM

Copy link
Copy Markdown

@Sheehan20 Sheehan20 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 implementation covers basic functionality, but could use additional test cases:

Error Payload Testing:

Add test for empty error message
Add test for different error status codes
Test complex error objects with nested properties

Edge Cases:

Test null/undefined error payload
Test malformed error objects
Test empty action objects

Test Organization:

Consider grouping test cases by action type (GET_ERRORS, CLEAR_ERRORS)
Add test descriptions as comments for better readability
Consider using test data fixtures for common error states

Peter-Nie2003

This comment was marked as abuse.

Copy link
Copy Markdown
Contributor

@vishavk1992 vishavk1992 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 successfully!! good work!!

Copy link
Copy Markdown

@SSP24SCM16G SSP24SCM16G left a comment

Choose a reason for hiding this comment

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

Every test case is working good.
Screenshot 2025-02-22 at 22 15 25

Copy link
Copy Markdown

@rohith1667 rohith1667 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!
Screenshot 2025-02-22 at 10 15 30 PM

Copy link
Copy Markdown
Contributor

@sundarmachani sundarmachani left a comment

Choose a reason for hiding this comment

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

Testcases executing successfully.

Screenshot 2025-02-27 at 9 05 06 PM

Copy link
Copy Markdown
Contributor

@puchakayalasaisaketh puchakayalasaisaketh 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 works well

image

@koushi1906
Copy link
Copy Markdown

All tests have passed.

Screenshot 2025-03-01 at 5 41 34 PM

@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit aa31073 into development Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible Moved to Final Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.