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

Next #533

Merged
merged 24 commits into from
Feb 7, 2025
Merged

Next #533

merged 24 commits into from
Feb 7, 2025

Conversation

geolffreym
Copy link
Member

No description provided.

cswni and others added 23 commits February 6, 2025 23:34
- **vite.config.ts**: Added Vitest configuration for testing, global enabled, jsdom environment, setup file, and coverage provider set to v8.
- **tsconfig.json & tsconfig.app.json**: Included Vitest and Testing Library types for type-checking.
- **package.json**: Added Vitest scripts (`test` and `test:coverage`), along with dependencies for Vitest, Testing Library, and related tooling.
- **setupTest.ts**: Added setup file to extend `expect` with Testing Library matchers.
- Added `modal.test.tsx` with tests to validate Modal behavior:
  - Ensures component matches the snapshot.
  - Confirms the title is displayed when `open` is true.
  - Verifies the title is absent when `open` is false.
- Created a snapshot file `modal.test.tsx.snap`.
- Exported `ModalProps` in `modal.tsx` to enable type usage in tests.
- Removed direct import of '@testing-library/jest-dom'.
- Updated to use matchers from '@testing-library/jest-dom/matchers'.
- Ensures consistency in imports and aligns with testing setup best practices.
- Removed unused `MemoryRouter` from `modal.test.tsx`.
- Updated snapshot-related test case to use `baseElement` for clarity.
- Added new test cases:
  - Verify modal content rendering.
  - Verify `onClose` prop is called when modal is closed.
- Revised and improved existing test case descriptions for readability.
- Deleted stale snapshot file `modal.test.tsx.snap`.
- Replace "make test" with "npm run test" in `.github/workflows/ci.yml`.
- Ensures consistency by aligning the test task with npm scripts.
- Improves clarity and uniformity in the CI process.
- Updated `.github/workflows/ci.yml`:
  - Modified the "Test" step to include coverage by running `npm run test -- --coverage`.
- Created a new snapshot file `modal.test.tsx.snap` under `src/components/test/__snapshots__`.
- Captures the rendered structure of the modal component to ensure consistent UI updates.
- Updated `.github/workflows/ci.yml`:
  - Added a step to cache Node.js dependencies using `actions/cache@v4`.
  - Configured cache key based on `package-lock.json` hash for efficient reuse.
This change aims to speed up CI runs and reduce redundant package installations.
- Updated the test command in `.github/workflows/ci.yml` to include the `--silent` flag for cleaner output.
- Commented out the "Generate report" step to disable its execution for now.
- Deleted the "Cache Node dependencies" step in `.github/workflows/ci.yml`.
- Rationale: Simplifies the workflow as caching is not necessary for the current setup.
```
# Conflicts:
#	.github/workflows/ci.yml
- Updated `.github/workflows/ci.yml` to include the `--coverage` flag when running tests.
- This ensures test coverage data is generated and can be uploaded to Codecov for better analysis.
- Updated `.github/workflows/ci.yml`:
  - Split the "Test" step into two separate steps: one for running tests (`npm run test`) and another for coverage generation (`npm run test:coverage`).
  - Ensures more granular execution and better step visibility in CI pipelines.
- Removed redundant "Coverage" step from `.github/workflows/ci.yml`.
- Ensured `test:coverage` is run only once during the CI process.
- Improved clarity and reduced duplication in the workflow configuration.
- Updated `.github/workflows/ci.yml`:
  - Replaced `codecov-action@v5` with `codecov-action@v4`.
  - Commented out unused `token` and `slug` parameters.
This ensures compatibility and simplifies configuration.
- Updated `.github/workflows/ci.yml`:
  - Un-commented `token` and `slug` parameters in Codecov action to enable coverage report uploads.
test: setup base for unit testing using vitest
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (main@0df5d59). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/sections/user/profile-transfer.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             main    #533   +/-   ##
======================================
  Coverage        ?   0.03%           
======================================
  Files           ?     557           
  Lines           ?   30734           
  Branches        ?     557           
======================================
  Hits            ?      11           
  Misses          ?   30167           
  Partials        ?     556           

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

Copy link

sonarqubecloud bot commented Feb 7, 2025

@geolffreym geolffreym merged commit 4a6e124 into main Feb 7, 2025
2 checks passed
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.

3 participants