-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Context
PR #7196 fixed the E2E test failures by temporarily removing attachment upload functionality from the advertisement creation flow. The backend schema was updated to accept FileMetadataInput[] instead of Upload[], which requires implementing a MinIO presigned upload flow.
Current State
- The
ADD_ADVERTISEMENT_MUTATIONschema now expectsattachments: [FileMetadataInput!]whereFileMetadataInputincludes:fileHash: String!mimeType: String!name: String!objectName: String!
- The frontend currently collects file objects but does not send them to the backend
- E2E tests skip attachment upload to prevent hanging on MinIO operations in CI
Implementation Requirements
Frontend Changes
-
Presigned URL Request Flow
- Add logic to request presigned URLs from the backend for file uploads
- Handle the presigned URL response and prepare for upload
-
MinIO Upload
- Implement file upload to MinIO using the presigned URL
- Handle upload progress and errors
- Construct
FileMetadataInputwith the required fields after successful upload
-
UI Updates
- Update
AdvertisementRegister.tsxto handle the new upload flow - Show upload progress/feedback to users
- Handle file validation (size, type, etc.)
- Update
E2E Test Changes
-
MinIO Mocking
- Use
cy.intercept()to mock MinIO presigned URL endpoints - Mock the file upload to MinIO (avoid actual uploads in CI)
- Mock the backend response with
FileMetadataInputdata
- Use
-
Test Coverage
- Update
cypress/e2e/admin_spec/advertisement.cy.tsto test attachment uploads - Restore file upload steps in
cypress/pageObjects/AdminPortal/AdvertisementPage.ts - Verify successful upload and attachment metadata in created advertisements
- Update
Acceptance Criteria
- Frontend successfully requests presigned URLs from the backend
- Files are uploaded to MinIO using presigned URLs
-
FileMetadataInputis correctly constructed and sent withADD_ADVERTISEMENT_MUTATION - Users can attach files when creating advertisements
- E2E tests properly mock MinIO operations (no actual uploads to MinIO in CI)
- E2E tests verify attachment upload functionality
- All existing tests continue to pass
References
- Original E2E fix PR:
#7196 - Original issue:
#7176 - PR discussion: fix: fixed E2E tests #7196 (comment)
Technical Notes
This is a feature implementation that was intentionally separated from the E2E test fix to maintain clear separation of concerns and reduce review complexity.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done