Skip to content

Commit 8e33ed2

Browse files
committed
some more tests
1 parent 079fc2a commit 8e33ed2

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"husky": "^0.14.3",
7676
"jest": "^20.0.4",
7777
"jsdom": "^11.1.0",
78-
"json-rules-engine": "^2.0.0",
7978
"lint-staged": "^4.0.0",
8079
"prettier": "^1.5.2",
8180
"regenerator-runtime": "^0.10.5",

test/validation.test.js

+16
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ test("invalid field NOT or", () => {
188188
expect(() => validatePredicates(invalidFieldNotWithOr, defSchema)).toThrow();
189189
});
190190

191+
test("invalid fields 1", () => {
192+
let inValidField = conditionsFrom([
193+
{
194+
conditions: {
195+
lastName: "empty",
196+
},
197+
event: {
198+
type: "remove",
199+
},
200+
},
201+
]);
202+
203+
expect(listAllFields(inValidField)).toEqual(["lastName"]);
204+
expect(() => validateConditionFields(inValidField, defSchema)).toThrow();
205+
});
206+
191207
test("valid field or", () => {
192208
let validFieldOr = conditionsFrom([
193209
{

0 commit comments

Comments
 (0)