Fix Drive video upload to Shopify

- Detect video mime types in MediaService to set correct resource ('VIDEO') and mediaContentType.

- Add fileSize to stagedUploadsCreate payload as required by Shopify for videos.

- Add safety check for missing upload targets to prevent crashes.

- Implement getSize in MockDriveService.

- Add unit test in MediaService.test.ts to verify correct resource and fileSize handling for video uploads.

- Update mock in mediaManager.integration.test.ts to support getSize().
This commit is contained in:
Ben Miller
2025-12-29 01:17:06 -07:00
parent e5ce154175
commit 19b3d5de2b
4 changed files with 59 additions and 2 deletions

View File

@ -72,6 +72,7 @@ describe("MediaService V2 Integration Logic", () => {
moveTo: jest.fn(),
getMimeType: () => "image/jpeg",
getBlob: () => ({}),
getSize: () => 1024,
getId: () => id
}))