-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Added test infrastructure and initial component tests #253
Closed
+1,675
−237
Conversation
This file contains 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
BREAKING CHANGE: Replaced direct cloud storage configuration with pre-signed URLs - Added pre-signed URL endpoint configuration - Removed cloud storage credentials from frontend - Deleted cloud storage config files - Updated upload logic to use pre-signed URLs - Simplified configuration interface
- Added CORS mode to uploadObject fetch request - Prettier fixes BREAKING CHANGE: Requires S3 bucket CORS configuration
- Added client-side SDK approach for cloud storage providers - Implemented AWS integration with presigned URLs - Added credential refresh and SAS token management - Implemented progress tracking and retry mechanisms - Fixed type errors and improve error handling - Removed unused code and align with latest SDK versions BREAKING CHANGE: Storage configuration requires provider-specific SDK setup
- Added client-side SDK approach for Azure provider - Implemented Azure integration with presigned URLs - Implemented progress tracking - Removed unused code and align with latest SDK versions
- Storage config only requires `provider` and `tokenEndpoint` values
- Added client-side SDK approach for DO provider - Implemented DO integration with presigned URLs
- Unified s3 client-side upload approach for S3 complaint storage providers
- preview url for uploaded files
- made ETag header conditional - removed `previewUrl` from object returned to FE
- changed folder structure to accommodate BE logic
- undid setting `Content-Type ` header when sending fetch request from `uploadObject` - improved logic for `handleError` - improved validation of required configuration - Enhanced error handling by including `xhr.status` and `xhr.statusText` when reporting error from `uploadWithProgress` - fixed issue with build failing when temp dist directory exists
- Configured Jest environment for React components and JSDOM - Added setupTests with necessary mocks for Google, Framer Motion - Implemented detailed test suite for MetaVersion, checkFileType, and s3GeneratePresignedUrl
amjedidiah
changed the title
feat: Added test infrastructure and initial component tests
[WIP] feat: Added test infrastructure and initial component tests
Nov 26, 2024
amjedidiah
changed the title
[WIP] feat: Added test infrastructure and initial component tests
feat: Added test infrastructure and initial component tests
Nov 26, 2024
BSalaeddin
reviewed
Nov 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions additional Test Cases:
Invalid s3ClientConfig: Test how the function behaves when provided with an invalid or incomplete s3ClientConfig.
it('should handle invalid s3ClientConfig', async () => {
const invalidS3Config = { ...mockS3Config, region: '' } // Empty region
await expect(
s3GeneratePresignedUrl({
fileParams: mockFileParams,
bucketName: mockBucketName,
s3ClientConfig: invalidS3Config,
origin: mockOrigin,
provider: mockProvider,
})
).rejects.toThrow(UploadError)
})
Missing Parameters: Ensure the function properly handles cases where required parameters are missing.
it('should throw an error when required parameters are missing', async () => {
await expect(
s3GeneratePresignedUrl({
fileParams: mockFileParams,
bucketName: '',
s3ClientConfig: mockS3Config,
origin: mockOrigin,
provider: mockProvider,
})
).rejects.toThrow(UploadError)
})
…graded coverage reporting feat: - Removed Codecov in favour of native Jest coverage reporting in CI - Added GitHub Actions artifact storage for coverage reports - Added detailed coverage threshold checks in CI pipeline - Updated `s3GeneratePresignedUrl` test suite per review to test for Invalid s3ClientConfig and Missing Parameters - Updated jest config to support coverage requirements
MedAmine1212
approved these changes
Nov 27, 2024
BSalaeddin
approved these changes
Nov 27, 2024
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.
Description
Sets up Jest testing infrastructure and initial tests for the Upup component library.
Changes
Test Setup
Usage