feat: wire up direct uploads with local file provider (#12643)

This commit is contained in:
Harminder Virk
2025-06-10 11:37:54 +02:00
committed by GitHub
parent 1a78476608
commit f2cb528a56
8 changed files with 112 additions and 57 deletions

View File

@@ -605,6 +605,22 @@ medusaIntegrationTestRunner({
'Invalid column name(s) "Product field"'
)
})
it("should handle error when the source file does not exists", async () => {
const { body, meta } = getUploadReq({
name: "test.csv",
key: "test.csv",
size: 0,
})
const batchJobRes = await api
.post("/admin/products/imports", body, meta)
.catch((e) => e)
expect(batchJobRes.response.data.message).toEqual(
"An unknown error occurred."
)
})
})
},
})

View File

@@ -55,7 +55,7 @@ medusaIntegrationTestRunner({
extension: "csv",
mime_type: "text/csv",
size: file.size,
url: expect.stringContaining(response.data.filename),
url: "/admin/uploads",
})
)
expect(response.status).toEqual(200)