fix(promotion): eval conditions for rules are made accurate (#10915)
what: - fixes eval conditions for promotion rules RESOLVES CMRC-851
This commit is contained in:
1 parent
cc73802ab3
commit
8119d9964b
6 files changed
+321
-86
No files matched your search
@@ -3,7 +3,6 @@ import {
|
||||
Modules,
|
||||
PriceListStatus,
|
||||
PriceListType,
|
||||
ProductStatus,
|
||||
PromotionRuleOperator,
|
||||
PromotionStatus,
|
||||
PromotionType,
|
||||
@@ -15,6 +14,7 @@ import {
|
||||
} from "../../../../helpers/create-admin-user"
|
||||
import { setupTaxStructure } from "../../../../modules/__tests__/fixtures"
|
||||
import { createAuthenticatedCustomer } from "../../../../modules/helpers/create-authenticated-customer"
|
||||
import { medusaTshirtProduct } from "../../../__fixtures__/product"
|
||||
|
||||
jest.setTimeout(100000)
|
||||
|
||||
@@ -30,70 +30,6 @@ const shippingAddressData = {
|
||||
postal_code: "94016",
|
||||
}
|
||||
|
||||
const productData = {
|
||||
title: "Medusa T-Shirt",
|
||||
handle: "t-shirt",
|
||||
status: ProductStatus.PUBLISHED,
|
||||
options: [
|
||||
{
|
||||
title: "Size",
|
||||
values: ["S"],
|
||||
},
|
||||
{
|
||||
title: "Color",
|
||||
values: ["Black", "White"],
|
||||
},
|
||||
],
|
||||
variants: [
|
||||
{
|
||||
title: "S / Black",
|
||||
sku: "SHIRT-S-BLACK",
|
||||
options: {
|
||||
Size: "S",
|
||||
Color: "Black",
|
||||
},
|
||||
manage_inventory: false,
|
||||
prices: [
|
||||
{
|
||||
amount: 1500,
|
||||
currency_code: "usd",
|
||||
},
|
||||
{
|
||||
amount: 1500,
|
||||
currency_code: "eur",
|
||||
},
|
||||
{
|
||||
amount: 1300,
|
||||
currency_code: "dkk",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "S / White",
|
||||
sku: "SHIRT-S-WHITE",
|
||||
options: {
|
||||
Size: "S",
|
||||
Color: "White",
|
||||
},
|
||||
manage_inventory: false,
|
||||
prices: [
|
||||
{
|
||||
amount: 1500,
|
||||
currency_code: "usd",
|
||||
},
|
||||
{
|
||||
amount: 1500,
|
||||
currency_code: "eur",
|
||||
},
|
||||
{
|
||||
amount: 1300,
|
||||
currency_code: "dkk",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
medusaIntegrationTestRunner({
|
||||
env,
|
||||
testSuite: ({ dbConnection, getContainer, api }) => {
|
||||
@@ -150,8 +86,9 @@ medusaIntegrationTestRunner({
|
||||
)
|
||||
).data.region
|
||||
|
||||
product = (await api.post("/admin/products", productData, adminHeaders))
|
||||
.data.product
|
||||
product = (
|
||||
await api.post("/admin/products", medusaTshirtProduct, adminHeaders)
|
||||
).data.product
|
||||
|
||||
salesChannel = (
|
||||
await api.post(
|
||||
|
||||
Reference in new issue
Block a user