Fix not in promotion rule empty value validation (#14172)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/promotion": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix not in promotion rule empty value validation
|
||||||
+1
@@ -35,6 +35,7 @@ moduleIntegrationTestRunner({
|
|||||||
expect(testFunc(["2"], operator, [2])).toEqual(false)
|
expect(testFunc(["2"], operator, [2])).toEqual(false)
|
||||||
expect(testFunc(["2"], operator, ["2"])).toEqual(false)
|
expect(testFunc(["2"], operator, ["2"])).toEqual(false)
|
||||||
expect(testFunc(["2"], operator, ["22"])).toEqual(true)
|
expect(testFunc(["2"], operator, ["22"])).toEqual(true)
|
||||||
|
expect(testFunc(["2"], operator, [])).toEqual(true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,12 @@ export function evaluateRuleValueCondition(
|
|||||||
: [ruleValuesToCheck]
|
: [ruleValuesToCheck]
|
||||||
|
|
||||||
if (!valuesToCheck.length) {
|
if (!valuesToCheck.length) {
|
||||||
return false
|
switch (operator) {
|
||||||
|
case "ne":
|
||||||
|
return true
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (operator) {
|
switch (operator) {
|
||||||
|
|||||||
Reference in New Issue
Block a user