Skip to content

Aaryaneil - Created unit tests for leaderboardDataReducer.#2738

Merged
one-community merged 1 commit into
developmentfrom
aaryaneil-unit-test-leaderboardDataReducer
Apr 3, 2025
Merged

Aaryaneil - Created unit tests for leaderboardDataReducer.#2738
one-community merged 1 commit into
developmentfrom
aaryaneil-unit-test-leaderboardDataReducer

Conversation

@aaryaneil
Copy link
Copy Markdown
Contributor

Description

Unit test for src/reducers/leaderboardDataReducer.js

Main changes explained:

Added test cases for the following:

  1. should return default state when no action is passed
  2. should return updated state when GET_LEADERBOARD_DATA action is passed
  3. should not mutate state when unknown action type is passed
  4. should return default state when no action is passed (orgDataReducer)
  5. should return updated state when GET_ORG_DATA action is passed
  6. should not mutate state when unknown action type is passed (orgDataReducer)

How to test:

  1. check into current branch
  2. do npm install and npm test leaderboardDataReducer.test.js

Screenshots or videos of changes:

Screenshot 2024-09-29 at 12 03 29 AM

@aaryaneil aaryaneil changed the title Created unit tests for leaderboardDataReducer. Aaryaneil - Created unit tests for leaderboardDataReducer. Sep 29, 2024
@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 29, 2024

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 3ab9b4b
🔍 Latest deploy log https://app.netlify.com/sites/highestgoodnetwork-dev/deploys/66f8fc82f6cad50008ee7411
😎 Deploy Preview https://deploy-preview-2738--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

@ishangoel17 ishangoel17 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 are passing. Below is the screenshot for reference:
Capture2738

Copy link
Copy Markdown
Contributor

@ziyanw52 ziyanw52 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 test and all the test cases passed!
WeChat46108337723d097b1ce55da6b2637e45

Copy link
Copy Markdown
Contributor

@Dk-21 Dk-21 left a comment

Choose a reason for hiding this comment

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

PR 2738
@aaryaneil
Tested the unit test file and all cases passed.

Screenshot 2024-09-30 at 8 28 33 PM

Copy link
Copy Markdown
Contributor

@RishithaMamidala RishithaMamidala left a comment

Choose a reason for hiding this comment

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

@aaryaneil
All test cases passed successfully. The reducers returned the default state when no action was passed, correctly updated the state for GET_LEADERBOARD_DATA and GET_ORG_DATA actions, and maintained state immutability when unknown action types were passed.
PR 2738

@anirudhsk2107 anirudhsk2107 self-requested a review October 1, 2024 02:57
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.

The unit tests are passing
PR_ 2738

Copy link
Copy Markdown
Contributor

@slidracoon72 slidracoon72 left a comment

Choose a reason for hiding this comment

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

#2738
@aaryaneil
Verified the unit test file, and all test cases successfully passed.

PR 2738

@tharunaa-1
Copy link
Copy Markdown

All the test cases passed. Looks just like expected.

image

Copy link
Copy Markdown

@Vigneshwar-Muriki Vigneshwar-Muriki left a comment

Choose a reason for hiding this comment

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

Tested this PR and all test cases passed.

Screenshot 2024-10-02 235118

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.
Screenshot (216)

@geetamatkar
Copy link
Copy Markdown
Contributor

Hi @aaryaneil ,
I tested this PR and all test cases have passed.

PR2738

@SatyashanthiT
Copy link
Copy Markdown
Contributor

I followed the provided steps and tested the PR for unit tests. All test cases passed successfully, including scenarios like GET_LEADERBOARD_DATA and handling unknown action types without mutating the state. The reducer's behavior was validated as expected, ensuring proper state updates and defaults.

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 below test cases were passed successfully.

should return default state when no action is passed
should return updated state when GET_LEADERBOARD_DATA action is passed
should not mutate state when unknown action type is passed
should return default state when no action is passed (orgDataReducer)
should return updated state when GET_ORG_DATA action is passed
should not mutate state when unknown action type is passed (orgDataReducer)

Kindly, find the screenshot below.

Screenshot_2738

Copy link
Copy Markdown
Contributor

@jinxyou jinxyou left a comment

Choose a reason for hiding this comment

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

image
All test cases have passed. Great work!

Copy link
Copy Markdown

@j-corp-25 j-corp-25 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 passing great job!
Screenshot 2024-10-06 at 2 19 48 AM

@chappdev2019
Copy link
Copy Markdown
Member

All tests passing

image

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.

I have tested this PR and all test cases passed successfully !!

Screenshot 2024-10-11 212848

@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit 52fdd73 into development Apr 3, 2025
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.