Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR, titled "Test fix", updates and standardizes several test files to align with new error response formats and updated testing practices for both client and server code.
- Updated client tests to use MemoryRouter and mock auth services properly.
- Revised server tests to validate error responses consistently and updated API payloads (e.g. donorIds instead of donors).
- Refactored CI workflow, Jest config, and helper utilities to support these changes.
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/App.test.jsx | Replaced BrowserRouter with MemoryRouter and added auth mocks. |
| Server/test/* | Updated error assertions and API endpoint tests for auth errors. |
| Server/test/helpers/testSetup.js | Added error handling for soft delete operations. |
| Server/jest.config.js | Converted to ES module export style. |
| .github/workflows/ci.yml | Updated CI steps for Node.js, client build, and server tests. |
| Server/test/donor/importDonor.test.js | Entire file removed, indicating potential deprecation. |
Files not reviewed (2)
- client/package-lock.json: Language not supported
- client/package.json: Language not supported
Comments suppressed due to low confidence (2)
Server/test/donorList/addDonors.test.js:261
- The test 'should handle multiple donors in a single request' sends only one donor ID. Consider updating the payload to include multiple donor IDs to accurately test the intended functionality.
donorIds: [
Server/test/donor/importDonor.test.js:1
- The entire donor import test file has been removed. If donor import functionality is still supported, please ensure that updated tests are added to maintain coverage.
import request from 'supertest';
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.