feat(core-flows,dashboard): adds item validations for claims, returns and exchanges (#8735)

what:

- adds item validations for claims, returns and exchanges
- prevents autofocus on item add
- reset item quantity when error
This commit is contained in:
Riqwan Thamir
2024-08-23 09:30:27 +00:00
committed by GitHub
parent b23f0f8188
commit 59599ac237
9 changed files with 217 additions and 54 deletions
@@ -427,6 +427,30 @@ medusaIntegrationTestRunner({
},
adminHeaders
)
const { response } = await api
.post(`/admin/exchanges/${exchangeId2}/request`, {}, adminHeaders)
.catch((e) => e)
expect(response.data).toEqual({
type: "invalid_data",
message:
"Order exchange request should have atleast 1 item inbound and 1 item outbound",
})
await api.post(
`/admin/exchanges/${exchangeId2}/outbound/items`,
{
items: [
{
variant_id: productExtra.variants[0].id,
quantity: 2,
},
],
},
adminHeaders
)
await api.post(
`/admin/exchanges/${exchangeId2}/request`,
{},