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

Create tests for OrganizationDashboard.tsx #1549

Closed
wants to merge 5 commits into from
Closed

Create tests for OrganizationDashboard.tsx #1549

wants to merge 5 commits into from

Conversation

Sauradip07
Copy link
Contributor

@Sauradip07 Sauradip07 commented Feb 6, 2024

Create tests for src/screens/OrganizationDashboard/OrganizationDashboard.tsx

Issue Number:

Fixes #1132

Did you add tests for your changes?
Yes

Snapshots/Videos:

Screenshot from 2024-02-06 15-20-51

Screenshot from 2024-02-06 15-21-11

Summary

Lines 86-94 & Lines 239-241 weren't covered by the tests It seems that Upcoming Events are mainly not covered
which introduce in Last PR of this File

Other information

I try to cover the entire useEffect hook
for Line 86 to 94

  // UseEffect to update upcomingEvents array
  useEffect(() => {
    if (eventData && eventData?.eventsByOrganizationConnection.length > 0) {
      const tempUpcomingEvents: InterfaceQueryOrganizationEventListItem[] = [];
      eventData?.eventsByOrganizationConnection.map((event: any) => {
        const startDate = new Date(event.startDate);
        const now = new Date();
        if (startDate > now) {
          tempUpcomingEvents.push(event);
        }
      });
      setUpcomingEvents(tempUpcomingEvents);
    }
  }, [eventData?.eventsByOrganizationConnection]);

The 239 to 241 is already Covered but not showed in Codecov
Have you read the contributing guide?

Yes

Please feel free to reach out if there are any modifications or any changes need to be made.

Copy link

github-actions bot commented Feb 6, 2024

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

@Cioppolo14
Copy link
Contributor

@beingnoble03 @Kevoniat Can you review this PR?

@aashimawadhwa
Copy link
Member

can you share the test coverage percentage? @Sauradip07

@PalisadoesFoundation PalisadoesFoundation deleted a comment from codecov bot Feb 6, 2024
@Sauradip07
Copy link
Contributor Author

can you share the test coverage percentage? @Sauradip07
Screenshot from 2024-02-06 22-13-52
Codecov report

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (655b6b3) 92.77% compared to head (a0491fe) 96.65%.
Report is 177 commits behind head on develop.

❗ Current head a0491fe differs from pull request most recent head d0c3ce4. Consider uploading reports for the commit d0c3ce4 to get more accurate results

Files Patch % Lines
src/components/OrgPostCard/OrgPostCard.tsx 69.23% 4 Missing ⚠️
src/components/OrgUpdate/OrgUpdate.tsx 93.75% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1549      +/-   ##
===========================================
+ Coverage    92.77%   96.65%   +3.88%     
===========================================
  Files          134      136       +2     
  Lines         3238     3587     +349     
  Branches       904     1101     +197     
===========================================
+ Hits          3004     3467     +463     
+ Misses         225      114     -111     
+ Partials         9        6       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@beingnoble03 beingnoble03 left a comment

Choose a reason for hiding this comment

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

Please address the comments.

Copy link
Member

@beingnoble03 beingnoble03 left a comment

Choose a reason for hiding this comment

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

Please follow the convention.

@palisadoes
Copy link
Contributor

Please fix the failing tests

@Sauradip07
Copy link
Contributor Author

Sauradip07 commented Feb 11, 2024

Please fix the failing tests
@palisadoes
The Test Failing because of OrgList component
Screenshot from 2024-02-11 22-18-54

In my PR, I don't change any file of OrgList component
The fix is Currently Done as a reference, I attach the SS here
Screenshot from 2024-02-11 22-39-18

I have to just re-run the CI to check is every thing is ok or not
I guess that fix the Failing test
Should I push Empty commit to run the CI again

@palisadoes
Copy link
Contributor

This should have been fixed. Do a minor commit to trigger the workflow

@palisadoes
Copy link
Contributor

You added too many new files.

  1. Please fix the conflicting files. They must all refer to our repo not yours.
  2. Merge with the latest upstream before

@Sauradip07 Sauradip07 closed this by deleting the head repository Feb 11, 2024
@Sauradip07
Copy link
Contributor Author

Sauradip07 commented Feb 11, 2024

@palisadoes
Creating A fresh PR #1577
Sorry For the inconvenience
I by mistake Delete the Fork repo that why this PR is Closed
my Bad

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.

5 participants