test(api): 🐛 Fix S3 tests

This commit is contained in:
Jesse Wierzbinski 2024-11-24 16:32:05 +01:00
parent 59b069ce2c
commit 80b5184d6a
No known key found for this signature in database

View file

@ -60,7 +60,7 @@ describe("S3MediaDriver", () => {
expect(mockS3Client.putObject).toHaveBeenCalledWith( expect(mockS3Client.putObject).toHaveBeenCalledWith(
"testhash/test.webp", "testhash/test.webp",
expect.any(ReadableStream), expect.any(ReadableStream),
{ size: file.size }, { size: file.size, metadata: { "Content-Type": file.type } },
); );
expect(result).toEqual({ expect(result).toEqual({
uploadedFile: file, uploadedFile: file,
@ -77,7 +77,12 @@ describe("S3MediaDriver", () => {
expect(mockS3Client.putObject).toHaveBeenCalledWith( expect(mockS3Client.putObject).toHaveBeenCalledWith(
expect.stringContaining("testhash"), expect.stringContaining("testhash"),
expect.any(ReadableStream), expect.any(ReadableStream),
{ size: file.size }, {
size: file.size,
metadata: {
"Content-Type": file.type,
},
},
); );
expect(result).toEqual({ expect(result).toEqual({
uploadedFile: expect.any(Blob), uploadedFile: expect.any(Blob),