feat:Add confirmation step to product import (#8284)

CLOSES CC-251
This commit is contained in:
Stevche Radevski
2024-07-25 14:54:31 +00:00
committed by GitHub
parent 7f4b085964
commit 6d0650818a
11 changed files with 100 additions and 14 deletions
@@ -168,8 +168,8 @@ medusaIntegrationTestRunner({
adminHeaders
)
const workflowId = batchJobRes.data.workflow_id
expect(workflowId).toBeTruthy()
const transactionId = batchJobRes.data.transaction_id
expect(transactionId).toBeTruthy()
await subscriberExecution
const notifications = (
@@ -214,8 +214,8 @@ medusaIntegrationTestRunner({
adminHeaders
)
const workflowId = batchJobRes.data.workflow_id
expect(workflowId).toBeTruthy()
const transactionId = batchJobRes.data.transaction_id
expect(transactionId).toBeTruthy()
await subscriberExecution
const notifications = (
@@ -101,8 +101,18 @@ medusaIntegrationTestRunner({
// BREAKING: The batch endpoints moved to the domain routes (admin/batch-jobs -> /admin/products/import). The payload and response changed as well.
const batchJobRes = await api.post("/admin/products/import", form, meta)
const workflowId = batchJobRes.data.workflow_id
expect(workflowId).toBeTruthy()
const transactionId = batchJobRes.data.transaction_id
expect(transactionId).toBeTruthy()
expect(batchJobRes.data.summary).toEqual({
toCreate: 1,
toUpdate: 1,
})
await api.post(
`/admin/products/import/${transactionId}/confirm`,
{},
meta
)
await subscriberExecution
const notifications = (