Skip to content

Commit

Permalink
fix(promotion): scope uniqueness index to non deleted promotions
Browse files Browse the repository at this point in the history
  • Loading branch information
riqwan committed Feb 26, 2025
1 parent 03731c7 commit b1d2c4c
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5009,26 +5009,31 @@ moduleIntegrationTestRunner({
context
)

expect(JSON.parse(JSON.stringify(result))).toEqual([
{
action: "addItemAdjustment",
item_id: "item_cotton_tshirt2",
amount: 1225,
code: "BUY50GET1000",
},
{
action: "addItemAdjustment",
item_id: "item_cotton_tshirt",
amount: 1275,
code: "BUY50GET1000",
},
{
action: "addItemAdjustment",
item_id: "item_cotton_tshirt2",
amount: 50,
code: "BUY10GET20",
},
])
const serializedResult = JSON.parse(JSON.stringify(result))

expect(serializedResult).toHaveLength(3)
expect(serializedResult).toEqual(
expect.arrayContaining([
{
action: "addItemAdjustment",
item_id: "item_cotton_tshirt2",
amount: 1225,
code: "BUY50GET1000",
},
{
action: "addItemAdjustment",
item_id: "item_cotton_tshirt",
amount: 1275,
code: "BUY50GET1000",
},
{
action: "addItemAdjustment",
item_id: "item_cotton_tshirt2",
amount: 50,
code: "BUY10GET20",
},
])
)
})

it("should compute adjustment accurately across items", async () => {
Expand Down
Loading

0 comments on commit b1d2c4c

Please sign in to comment.