feat(core-flows): manage inventory reservation of claims and exchanges (#8448)
This commit is contained in:
@@ -518,6 +518,15 @@ medusaIntegrationTestRunner({
|
||||
expect(result[0].claim_items).toHaveLength(1)
|
||||
expect(result[0].canceled_at).toBeNull()
|
||||
|
||||
const reservationsResponse = (
|
||||
await api.get(
|
||||
`/admin/reservations?location_id[]=${location.id}`,
|
||||
adminHeaders
|
||||
)
|
||||
).data
|
||||
|
||||
expect(reservationsResponse.reservations).toHaveLength(1)
|
||||
|
||||
await api.post(`/admin/claims/${claimId}/cancel`, {}, adminHeaders)
|
||||
|
||||
result = (
|
||||
@@ -527,6 +536,15 @@ medusaIntegrationTestRunner({
|
||||
)
|
||||
).data.claims
|
||||
expect(result[0].canceled_at).toBeDefined()
|
||||
|
||||
const reservationsResponseAfterCanceling = (
|
||||
await api.get(
|
||||
`/admin/reservations?location_id[]=${location.id}`,
|
||||
adminHeaders
|
||||
)
|
||||
).data
|
||||
|
||||
expect(reservationsResponseAfterCanceling.reservations).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -489,7 +489,7 @@ medusaIntegrationTestRunner({
|
||||
|
||||
result = (
|
||||
await api.get(
|
||||
`/admin/exchanges?fields=*additional_items`,
|
||||
`/admin/exchanges?fields=+metadata,*additional_items`,
|
||||
adminHeaders
|
||||
)
|
||||
).data.exchanges
|
||||
|
||||
Reference in New Issue
Block a user