core(core-flows, medusa): remove request item return (#8146)
This commit is contained in:
1 parent
4024935e91
commit
5813216c88
16 files changed
+320
-20
No files matched your search
@@ -228,6 +228,57 @@ medusaIntegrationTestRunner({
|
||||
total: 50,
|
||||
fulfilled_total: 50,
|
||||
return_requested_total: 50,
|
||||
detail: expect.objectContaining({
|
||||
return_requested_quantity: 1,
|
||||
}),
|
||||
}),
|
||||
]),
|
||||
})
|
||||
)
|
||||
|
||||
// Remove item return requesta
|
||||
const returnItemActionId =
|
||||
result.data.order_preview.items[0].actions[0].id
|
||||
result = await api.delete(
|
||||
`/admin/returns/${returnId}/request-items/${returnItemActionId}`,
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
expect(result.data.order_preview).toEqual(
|
||||
expect.objectContaining({
|
||||
id: order.id,
|
||||
items: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
detail: expect.objectContaining({
|
||||
return_requested_quantity: 0,
|
||||
}),
|
||||
}),
|
||||
]),
|
||||
})
|
||||
)
|
||||
|
||||
// Add item return request again
|
||||
result = await api.post(
|
||||
`/admin/returns/${returnId}/request-items`,
|
||||
{
|
||||
items: [
|
||||
{
|
||||
id: item.id,
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
expect(result.data.order_preview).toEqual(
|
||||
expect.objectContaining({
|
||||
id: order.id,
|
||||
items: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
detail: expect.objectContaining({
|
||||
return_requested_quantity: 1,
|
||||
}),
|
||||
}),
|
||||
]),
|
||||
})
|
||||
@@ -300,12 +351,13 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
expect(result.data.order_preview.shipping_methods).toHaveLength(2)
|
||||
|
||||
// remove shipping method
|
||||
const action_id = result.data.order_preview.shipping_methods[1].actions[0].id
|
||||
const shippingActionId =
|
||||
result.data.order_preview.shipping_methods[1].actions[0].id
|
||||
result = await api.delete(
|
||||
`/admin/returns/${returnId}/shipping-method/${action_id}`,
|
||||
`/admin/returns/${returnId}/shipping-method/${shippingActionId}`,
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
|
||||
@@ -205,8 +205,9 @@ medusaIntegrationTestRunner({
|
||||
metadata: null,
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
deleted_at: null,
|
||||
tax_lines: [],
|
||||
adjustments: [
|
||||
adjustments: expect.arrayContaining([
|
||||
{
|
||||
id: expect.any(String),
|
||||
description: "VIP discount",
|
||||
@@ -219,6 +220,7 @@ medusaIntegrationTestRunner({
|
||||
provider_id: expect.any(String),
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
deleted_at: null,
|
||||
item_id: expect.any(String),
|
||||
amount: 5e-18,
|
||||
subtotal: 5e-18,
|
||||
@@ -232,7 +234,7 @@ medusaIntegrationTestRunner({
|
||||
precision: 20,
|
||||
},
|
||||
},
|
||||
],
|
||||
]),
|
||||
compare_at_unit_price: null,
|
||||
unit_price: 50,
|
||||
quantity: 1,
|
||||
@@ -412,7 +414,7 @@ medusaIntegrationTestRunner({
|
||||
metadata: null,
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
tax_lines: [
|
||||
tax_lines: expect.arrayContaining([
|
||||
{
|
||||
id: expect.any(String),
|
||||
description: "shipping Tax 1",
|
||||
@@ -425,6 +427,7 @@ medusaIntegrationTestRunner({
|
||||
provider_id: null,
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
deleted_at: null,
|
||||
shipping_method_id: expect.any(String),
|
||||
rate: 10,
|
||||
total: 0.9,
|
||||
@@ -438,8 +441,8 @@ medusaIntegrationTestRunner({
|
||||
precision: 20,
|
||||
},
|
||||
},
|
||||
],
|
||||
adjustments: [
|
||||
]),
|
||||
adjustments: expect.arrayContaining([
|
||||
{
|
||||
id: expect.any(String),
|
||||
description: "VIP discount",
|
||||
@@ -452,6 +455,7 @@ medusaIntegrationTestRunner({
|
||||
provider_id: null,
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
deleted_at: null,
|
||||
shipping_method_id: expect.any(String),
|
||||
amount: 1,
|
||||
subtotal: 1,
|
||||
@@ -465,7 +469,7 @@ medusaIntegrationTestRunner({
|
||||
precision: 20,
|
||||
},
|
||||
},
|
||||
],
|
||||
]),
|
||||
amount: 10,
|
||||
subtotal: 10,
|
||||
total: 9.9,
|
||||
|
||||
Reference in new issue
Block a user