fix(cart): add shipping method to cart (#7945)

This commit is contained in:
Carlos R. L. Rodrigues
2024-07-04 12:47:39 +00:00
committed by GitHub
parent f4225c051f
commit d036130604
4 changed files with 64 additions and 4 deletions
@@ -1500,6 +1500,21 @@ medusaIntegrationTestRunner({
},
})
await addShippingMethodToWorkflow(appContainer).run({
input: {
options: [{ id: shippingOption.id }],
cart_id: cart.id,
},
})
// should remove the previous shipping method
await addShippingMethodToWorkflow(appContainer).run({
input: {
options: [{ id: shippingOption.id }],
cart_id: cart.id,
},
})
cart = await cartModuleService.retrieveCart(cart.id, {
relations: ["shipping_methods"],
})
@@ -1508,12 +1523,12 @@ medusaIntegrationTestRunner({
expect.objectContaining({
id: cart.id,
currency_code: "usd",
shipping_methods: expect.arrayContaining([
shipping_methods: [
expect.objectContaining({
amount: 3000,
name: "Test shipping option",
}),
]),
],
})
)
})