feat(core-flows, fulfillment): validate shipping options to stock locations (#8291)

what:

- validate shipping options to stock locations

RESOLVES CC-232
This commit is contained in:
Riqwan Thamir
2024-07-26 12:26:26 +00:00
committed by GitHub
parent 74d0d166b3
commit 91c17651f1
23 changed files with 607 additions and 18 deletions
@@ -1480,6 +1480,36 @@ medusaIntegrationTestRunner({
})
it("should add shipping method to cart", async () => {
const stockLocation = (
await api.post(
`/admin/stock-locations`,
{ name: "test location" },
adminHeaders
)
).data.stock_location
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: stockLocation.id,
},
[Modules.FULFILLMENT]: {
fulfillment_set_id: fulfillmentSet.id,
},
},
])
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: stockLocation.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
const shippingOption = await fulfillmentModule.createShippingOptions({
name: "Test shipping option",
service_zone_id: fulfillmentSet.service_zones[0].id,
@@ -1930,6 +1930,28 @@ medusaIntegrationTestRunner({
)
).data.product
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: stockLocation.id,
},
[Modules.FULFILLMENT]: {
fulfillment_set_id: fulfillmentSet.id,
},
},
])
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: stockLocation.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
shippingOption = (
await api.post(
`/admin/shipping-options`,