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

Changed the OrgContribution Code from Jest to Vitest #2710

Closed
wants to merge 1,152 commits into from

Conversation

Akshat76845
Copy link
Contributor

@Akshat76845 Akshat76845 commented Dec 22, 2024

What kind of change does this PR introduce?
Changed the code from Jest to Vitest

Issue Number:

Fixes #2564

If relevant, did you update the documentation?

Summary
This PR addresses the following issues:
Changed the code from Jest to Vitest

Does this PR introduce a breaking change?
No

Have you read the contributing guide?
Yes

Summary by CodeRabbit

  • New Features

    • Introduced new configuration files for various tools and workflows, enhancing project structure and automation.
    • Added comprehensive localization support for multiple languages including English, French, Hindi, Spanish, and Chinese.
    • Implemented a detailed GraphQL schema for managing action items, events, and users with robust error handling and authorization mechanisms.
  • Documentation

    • Added new documentation files including installation guides, contribution guidelines, and style guides to improve clarity for contributors and users.
  • Bug Fixes

    • Updated various files to improve linting, formatting, and error handling across the project.
  • Chores

    • Removed obsolete files and configurations to streamline the project structure and enhance maintainability.

dependabot bot and others added 30 commits July 4, 2024 11:55
…tion#2067)

Bumps [@mui/x-charts](https://github.com/mui/mui-x/tree/HEAD/packages/x-charts) from 7.6.2 to 7.8.0.
- [Release notes](https://github.com/mui/mui-x/releases)
- [Changelog](https://github.com/mui/mui-x/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/mui-x/commits/v7.8.0/packages/x-charts)

---
updated-dependencies:
- dependency-name: "@mui/x-charts"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…undation#2068)

Bumps [react-datepicker](https://github.com/Hacker0x01/react-datepicker) from 4.16.0 to 7.2.0.
- [Release notes](https://github.com/Hacker0x01/react-datepicker/releases)
- [Commits](Hacker0x01/react-datepicker@v4.16.0...v7.2.0)

---
updated-dependencies:
- dependency-name: react-datepicker
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tsx](https://github.com/privatenumber/tsx) from 4.15.5 to 4.16.0.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](privatenumber/tsx@v4.15.5...v4.16.0)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Updated user post screen ui

* removed unwanted code

* fix: failing tests
…#2051)

* Add English translation for `makeActive` string in Action Items status update modal

* PalisadoesFoundation#2048 Added all translations for `Active` button and test cases for it
* svg, tab button created in event dashboard, and translations for that

* mutation and query added

* create,preview,delete button completed

* updation fixed

* no category feature done

* dropdown btn created for regular & note

* dropdown btn deleted for regular & note, drag and drop created

* test cases, some are incomplete

* translations added

* coverage improved

* code rabbit suggestions resolved

* coverage improved for create modal

* coverage improved for update modal

* coverage improved for preview modal

* coverage improved for create and update modal

* coverage improved

* it's responsive now
* fix id bug

* Revert "fix id bug"

This reverts commit f0bbd45.

* fixed errors and success messages

* chore: Remove eslint-disable in PostCard component

* add translations

* fix tests
…on#2077)

* fix id bug

* Revert "fix id bug"

This reverts commit f0bbd45.

* db for translations

* Update package-lock.json

* fix lang dropdown tests

* trycatch

* unused login file

* fix tests
…oesFoundation#2079)

Bumps [react-google-recaptcha](https://github.com/dozoisch/react-google-recaptcha) from 2.1.0 to 3.1.0.
- [Changelog](https://github.com/dozoisch/react-google-recaptcha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dozoisch/react-google-recaptcha/commits)

---
updated-dependencies:
- dependency-name: react-google-recaptcha
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…sFoundation#2080)

Bumps [i18next-http-backend](https://github.com/i18next/i18next-http-backend) from 1.4.5 to 2.5.2.
- [Changelog](https://github.com/i18next/i18next-http-backend/blob/master/CHANGELOG.md)
- [Commits](i18next/i18next-http-backend@v1.4.5...v2.5.2)

---
updated-dependencies:
- dependency-name: i18next-http-backend
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…doesFoundation#2081)

Bumps [typedoc-plugin-markdown](https://github.com/typedoc2md/typedoc-plugin-markdown/tree/HEAD/packages/typedoc-plugin-markdown) from 4.0.3 to 4.1.2.
- [Release notes](https://github.com/typedoc2md/typedoc-plugin-markdown/releases)
- [Changelog](https://github.com/typedoc2md/typedoc-plugin-markdown/blob/main/packages/typedoc-plugin-markdown/CHANGELOG.md)
- [Commits](https://github.com/typedoc2md/typedoc-plugin-markdown/commits/[email protected]/packages/typedoc-plugin-markdown)

---
updated-dependencies:
- dependency-name: typedoc-plugin-markdown
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…oundation#2082)

Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.23.1 to 6.24.1.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/[email protected]/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tsx](https://github.com/privatenumber/tsx) from 4.16.0 to 4.16.2.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](privatenumber/tsx@v4.16.0...v4.16.2)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…doesFoundation#2089)

Bumps [typedoc-plugin-markdown](https://github.com/typedoc2md/typedoc-plugin-markdown/tree/HEAD/packages/typedoc-plugin-markdown) from 4.1.2 to 4.2.1.
- [Release notes](https://github.com/typedoc2md/typedoc-plugin-markdown/releases)
- [Changelog](https://github.com/typedoc2md/typedoc-plugin-markdown/blob/main/packages/typedoc-plugin-markdown/CHANGELOG.md)
- [Commits](https://github.com/typedoc2md/typedoc-plugin-markdown/commits/[email protected]/packages/typedoc-plugin-markdown)

---
updated-dependencies:
- dependency-name: typedoc-plugin-markdown
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…esFoundation#2090)

Bumps [@mui/icons-material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-icons-material) from 5.14.0 to 5.16.1.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/v5.16.1/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.16.1/packages/mui-icons-material)

---
updated-dependencies:
- dependency-name: "@mui/icons-material"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#2091)

Bumps [bootstrap](https://github.com/twbs/bootstrap) from 5.3.0 to 5.3.3.
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](twbs/bootstrap@v5.3.0...v5.3.3)

---
updated-dependencies:
- dependency-name: bootstrap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ndation#2093)

Bumps [react-datepicker](https://github.com/Hacker0x01/react-datepicker) from 7.2.0 to 7.3.0.
- [Release notes](https://github.com/Hacker0x01/react-datepicker/releases)
- [Commits](Hacker0x01/react-datepicker@v7.2.0...v7.3.0)

---
updated-dependencies:
- dependency-name: react-datepicker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#2064)

* refac/redesign Funds

* refac/redesign campaigns

* Add sort/search in Funds

* Added breadcrumbs

* Add sort/search in Campaigns

* add tests

* add translations

* cleanup

* missing translation

* Add progress indicator in pledges screen

* incorp coderab changes

* Added popup to view all volunteers

* Add progress bar for Raised & Pledged

* set raised to 0

* update test case

* rerun

* removed progressbar animation
…oundation#2105)

Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.24.1 to 6.25.1.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/[email protected]/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ndation#2106)

Bumps [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) from 5.15.20 to 5.16.4.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/next/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.16.4/packages/mui-material)

---
updated-dependencies:
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#2108)

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.8.2 to 16.9.0.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.8.2...v16.9.0)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…adoesFoundation#2049)

* Event and Organization Action item layouts need to be the same

* Implemented the suggested changes by coderabbitai to the spreading of `formstate`.

* Refactor column config on Event Actions page to fix lint error line numbers exceeded

* Replace MUI Button component with default react-bootstrap Button

* Feature matching event action item table and org action item table

* Changed key to `member._id` from index

* Added test cases for code coverage

* Added test case for status change functionality

* Added test case for preCompletionNotes and postCompletionNotes column

* Added test case for postCompletionNotes when its length is less than 25

* Added test case for completion Date

* Added ignore code coverage command

---------

Co-authored-by: Peter Harrison <[email protected]>
filtered out events from action items and created unit test to verify only action items are being displayed
* upgrade web vitals package to 4.0.2

* upgrade web vitals package to 4.0.2
* Upgrade package mui/x-data-grid

* Fixed format by npm run foramt:fix
…lisadoesFoundation#2116)

* Added tooltip

* fixed some css

* Update src/components/UserProfileSettings/UserProfile.tsx

Co-authored-by: Vamshi Maskuri <[email protected]>

* Update src/components/UserProfileSettings/UserProfile.tsx

Co-authored-by: Vamshi Maskuri <[email protected]>

* corrected tests

---------

Co-authored-by: Vamshi Maskuri <[email protected]>
* Corrected the joining date on user profile

* Fixed tests

* changed function name to joinedDate
Akshat and others added 24 commits December 21, 2024 22:46
)

* refactor:vitest to EventVolunteers/Volunteers

* fix:coderabbit sugg
…dation#2694)

* chore: migrated leaderboard tests jest to vitest

* docs: Added comments for leaderboard tests
PalisadoesFoundation#2619)

* migrate jest to vitetst

* migrate jest to vitetst

* migrate jest to vitetst ignore

* migrate jest to vitetst eslint fix

* ignore action.tsx

* migrate jest to vitetst vite config change

* coderabbitai asked changes

* revert vitest.config.ts

* fixing merge issue

* tsdoc issue fix

* Enhance the useNavigate mock implementation.

* trying to inc code range

* test failing fix

* test  fix

* test fail fix trying

* fix organization issue ts

* action.spec waitfor issue fix

* excluded uncessary file

* fix test failed issue

* yearlyEvent calender coverage increase

* inc code cov

* setting revert back

* setting revert

* organisation covergae

* unwanted file

* ignoring covergae for setup.ts

* ignoring setup.ts

* revert back changes

* removing ignore comment

* schema fix

* schema fix

* test to spec

* revert test to spec

* revert pull req change

* codeai to resole

* codeai to resole

* removing spec file from jest

* code coverage fix

* code coverage fix

* code coverage fix

* code patch inc

* code patch inc

* inc path coverage for eventstatiscs

---------

Co-authored-by: Vamshi Maskuri <[email protected]>
Co-authored-by: Mayankpulse333 <[email protected]>
…sadoesFoundation#2678)

* migrate OrganizationDashboard tests from Jest to Vitest and fixed all the failing tests

* chore: Removed debug console.log statements

---------

Co-authored-by: Vamshi Maskuri <[email protected]>
Copy link
Contributor

coderabbitai bot commented Dec 22, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces comprehensive configuration and documentation updates for the Talawa Admin project. The changes include setting up new configuration files for various tools like CodeRabbit, Docker, ESLint, and Vite, adding localization files for multiple languages, updating GitHub workflows, and enhancing project documentation. The modifications aim to improve development workflows, testing processes, and internationalization support.

Changes

File/Directory Change Summary
.coderabbit.yaml New configuration file for CodeRabbit AI review settings
.dockerignore New file to exclude unnecessary files from Docker builds
.env.example Added environment variable template for local development
.eslintignore Updated to exclude specific files from linting
.eslintrc.json Enhanced ESLint configuration with new plugins and rules
.github/workflows/ Multiple new and updated workflow files for CI/CD processes
Dockerfile New Docker configuration for application deployment
public/locales/ Added localization files for English, French, Hindi, Spanish, and Chinese
package.json Significant updates to dependencies, scripts, and project configuration
Configuration files Added babel.config.cjs, vite.config.ts, jest.config.js
Documentation Updated README.md, CONTRIBUTING.md, INSTALLATION.md, and added new documentation files

Assessment against linked issues

Objective Addressed Explanation
Refactor src/screens/OrgContribution from Jest to Vitest [#2564] Partial configuration changes made, but specific test refactoring not visible in this PR

Possibly related issues

Possibly related PRs

Suggested reviewers

Poem

🐰 A Rabbit's Configuration Delight 🚀

Configs dance, workflows sing bright,
Locales bloom in languages light,
Docker builds with elegant might,
Vitest and Jest in testing's flight,
CodeRabbit watches with pure delight!

- Whiskers the DevOps Rabbit 🌈

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

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

@Akshat76845 Akshat76845 deleted the vitestt branch December 22, 2024 06:25
@Akshat76845 Akshat76845 restored the vitestt branch December 22, 2024 06:35
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.

Refactor: src/screens/OrgContribution from Jest to Vitest