fix(promotion, core-flows): updating cart with removed promotion removes adjustments (#10489)
This commit is contained in:
-62
@@ -57,68 +57,6 @@ moduleIntegrationTestRunner({
|
||||
|
||||
expect(response).toEqual([])
|
||||
})
|
||||
|
||||
it("should throw error when code in items adjustment does not exist", async () => {
|
||||
await createDefaultPromotion(service, {})
|
||||
|
||||
const error = await service
|
||||
.computeActions(["PROMOTION_TEST"], {
|
||||
items: [
|
||||
{
|
||||
id: "item_cotton_tshirt",
|
||||
quantity: 1,
|
||||
subtotal: 100,
|
||||
adjustments: [
|
||||
{
|
||||
id: "test-adjustment",
|
||||
code: "DOES_NOT_EXIST",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "item_cotton_sweater",
|
||||
quantity: 5,
|
||||
subtotal: 750,
|
||||
},
|
||||
],
|
||||
})
|
||||
.catch((e) => e)
|
||||
|
||||
expect(error.message).toContain(
|
||||
"Applied Promotion for code (DOES_NOT_EXIST) not found"
|
||||
)
|
||||
})
|
||||
|
||||
it("should throw error when code in shipping adjustment does not exist", async () => {
|
||||
await createDefaultPromotion(service, {})
|
||||
|
||||
const error = await service
|
||||
.computeActions(["PROMOTION_TEST"], {
|
||||
items: [
|
||||
{
|
||||
id: "item_cotton_tshirt",
|
||||
quantity: 1,
|
||||
subtotal: 100,
|
||||
},
|
||||
{
|
||||
id: "item_cotton_sweater",
|
||||
quantity: 5,
|
||||
subtotal: 750,
|
||||
adjustments: [
|
||||
{
|
||||
id: "test-adjustment",
|
||||
code: "DOES_NOT_EXIST",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
.catch((e) => e)
|
||||
|
||||
expect(error.message).toContain(
|
||||
"Applied Promotion for code (DOES_NOT_EXIST) not found"
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe("when promotion is for items and allocation is each", () => {
|
||||
|
||||
Reference in New Issue
Block a user