Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olivermrbl committed Jan 16, 2024
1 parent 37f6ef3 commit 1e3f57e
Showing 1 changed file with 0 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -600,71 +600,6 @@ describe("Cart Module Service", () => {

expect(cart.items?.length).toBe(0)
})

it("should update multiples line items in cart succesfully", async () => {
const [createdCart] = await service.create([
{
currency_code: "eur",
},
])

const items = await service.addLineItems(createdCart.id, [
{
quantity: 1,
unit_price: 100,
title: "test",
},
{
quantity: 2,
unit_price: 200,
title: "other-test",
},
])

expect(items).toEqual(
expect.arrayContaining([
expect.objectContaining({
title: "test",
quantity: 1,
unit_price: 100,
}),
expect.objectContaining({
title: "other-test",
quantity: 2,
unit_price: 200,
}),
])
)

const itemOne = items.find((i) => i.title === "test")
const itemTwo = items.find((i) => i.title === "other-test")

const updatedItems = await service.updateLineItems(createdCart.id, [
{
id: itemOne!.id,
title: "changed-test",
},
{
id: itemTwo!.id,
title: "changed-other-test",
},
])

expect(updatedItems).toEqual(
expect.arrayContaining([
expect.objectContaining({
title: "changed-test",
quantity: 1,
unit_price: 100,
}),
expect.objectContaining({
title: "changed-other-test",
quantity: 2,
unit_price: 200,
}),
])
)
})
})

describe("addShippingMethods", () => {
Expand Down

0 comments on commit 1e3f57e

Please sign in to comment.