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

UserScreen Test migration from jest to vitest #2628

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
node_modules
npm-debug.log
Dockerfile
.git
.gitignore
.env
.env.*
dist
coverage
.nyc_output
*.md
.github
tests
__tests__
*.test.*
*.spec.*
# Development files
*.log
*.lock
.DS_Store
.idea
.vscode
# Build artifacts
build
out
8 changes: 7 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Contains the PDF file of the Tag as JSON string, thus does not need to be linted
src/components/CheckIn/tagTemplate.ts
src/components/CheckIn/tagTemplate.ts
package.json
package-lock.json
tsconfig.json
docker-compose.yml
Dockerfile
nginx.conf
16 changes: 6 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"es6": true
},

// Specify the rulesets from other ESLint Plugins tobe used
"extends": [
"plugin:react/recommended",
"eslint:recommended",
Expand All @@ -28,7 +27,6 @@
"sourceType": "module"
},

// Specify the ESLint plugins tobe used
"plugins": [
"react",
"@typescript-eslint",
Expand All @@ -55,6 +53,7 @@
"import/no-duplicates": "error",
"tsdoc/syntax": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
Expand All @@ -77,13 +76,13 @@
"camelcase": "off",
"@typescript-eslint/naming-convention": [
"error",
// Interfaces must begin with Interface or TestInterface followed by a PascalCase name

{
"selector": "interface",
"format": ["PascalCase"],
"prefix": ["Interface", "TestInterface"]
},
// Type Aliases must be in PascalCase

{
"selector": ["typeAlias", "typeLike", "enum"],
"format": ["PascalCase"]
Expand Down Expand Up @@ -120,20 +119,17 @@
"format": null
}
],
// Ensures that components are always written in PascalCase

"react/jsx-pascal-case": [
"error",
{ "allowAllCaps": false, "allowNamespace": false }
],

// Enforces whitespace around equal sign operators
"react/jsx-equals-spacing": ["warn", "never"],
"react/no-this-in-sfc": "error",

// All tests must need not have an assertion
"jest/expect-expect": 0,

// Enforce Strictly functional components
"react/no-unstable-nested-components": ["error", { "allowAsProps": true }],
"react/function-component-definition": [
0,
Expand All @@ -142,10 +138,10 @@
"prettier/prettier": "error"
},

// Let ESLint use the react version in the package.json
"settings": {
"react": {
"version": "detect"
}
}
},
"ignorePatterns": ["**/*.css", "**/*.scss", "**/*.less", "**/*.json"]
}
2 changes: 1 addition & 1 deletion .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ updates:
labels:
- "dependencies"
# Specify the target branch for PRs
target-branch: "develop"
target-branch: "develop-postgres"
# Customize commit message prefix
commit-message:
prefix: "chore(deps):"
21 changes: 16 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!--
This section can be deleted after reading.

Expand All @@ -9,6 +10,7 @@ We employ the following branching strategy to simplify the development process a
NOTE!!!

ONLY SUBMIT PRS AGAINST OUR `DEVELOP` BRANCH. THE DEFAULT IS `MAIN`, SO YOU WILL HAVE TO MODIFY THIS BEFORE SUBMITTING YOUR PR FOR REVIEW. PRS MADE AGAINST `MAIN` WILL BE CLOSED.

-->

<!--
Expand All @@ -23,10 +25,6 @@ Thanks for submitting a pull request! Please provide enough information so that

Fixes #<!--Add related issue number here.-->

**Did you add tests for your changes?**

<!--Yes or No. Note: Add unit tests or automation tests for your code.-->

**Snapshots/Videos:**

<!--Add snapshots or videos wherever possible.-->
Expand All @@ -44,10 +42,23 @@ Fixes #<!--Add related issue number here.-->

<!-- If this PR introduces a breaking change, please describe the impact and a migration path for existing applications. -->

## Checklist

### CodeRabbit AI Review
- [ ] I have reviewed and addressed all critical issues flagged by CodeRabbit AI
- [ ] I have implemented or provided justification for each non-critical suggestion
- [ ] I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

### Test Coverage
- [ ] I have written tests for all new changes/features
- [ ] I have verified that test coverage meets or exceeds 95%
- [ ] I have run the test suite locally and all tests pass


**Other information**

<!--Add extra information about this PR here-->

**Have you read the [contributing guide](https://github.com/PalisadoesFoundation/talawa-admin/blob/master/CONTRIBUTING.md)?**

<!--Yes or No-->
<!--Yes or No-->
6 changes: 3 additions & 3 deletions .github/workflows/codeql-codescan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
debug: true

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: Renato66/auto-label@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@v6
- uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/pull-request-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Add the PR Review Policy
uses: thollander/actions-comment-pull-request@v2
uses: thollander/actions-comment-pull-request@v3
with:
comment_tag: pr_review_policy
comment-tag: pr_review_policy
message: |
## Our Pull Request Approval Process

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

Thanks for contributing!
### 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.
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.
1. We don't merge PRs with failed tests.
1. When tests fail, click on the `Details` link to learn more.
1. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
1. Tests may fail if you edit sensitive files. Ask to add the `ignore-sensitive-files-pr` label if the edits are necessary.
1. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

### Reviewers

Expand Down
Loading
Loading