Skip to content

Commit 0ba0976

Browse files
committed
more varied test cases
1 parent b78035e commit 0ba0976

File tree

1 file changed

+50
-4
lines changed

1 file changed

+50
-4
lines changed

tests/draft-next/propertyDependencies.json

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,70 @@
9090
]
9191
},
9292
{
93-
"description": "disallowing values",
93+
"description": "multiple options selects the right one",
9494
"schema": {
9595
"propertyDependencies": {
96-
"foo": {"bar": {"minProperties": 2}}
96+
"foo": {
97+
"bar": {
98+
"minProperties": 2,
99+
"maxProperties": 2
100+
},
101+
"baz": {"maxProperties": 1},
102+
"qux": true,
103+
"quux": false
104+
}
97105
}
98106
},
99107
"tests": [
100108
{
101-
"description": "bar with 2 properties is valid",
109+
"description": "bar with exactly 2 properties is valid",
102110
"data": {
103111
"foo": "bar",
104112
"other-foo": "other-bar"
105113
},
106114
"valid": true
107115
},
108116
{
109-
"description": "bar without another property is invalid",
117+
"description": "bar with more than 2 properties is invalid",
118+
"data": {
119+
"foo": "bar",
120+
"other-foo": "other-bar",
121+
"too": "many"
122+
},
123+
"valid": false
124+
},
125+
{
126+
"description": "bar with fewer than 2 properties is invalid",
127+
"data": {"foo": "bar"},
128+
"valid": false
129+
},
130+
{
131+
"description": "baz alone is valid",
110132
"data": {"foo": "baz"},
133+
"valid": true
134+
},
135+
{
136+
"description": "baz with other properties is invalid",
137+
"data": {
138+
"foo": "baz",
139+
"other-foo": "other-bar"
140+
},
141+
"valid": false
142+
},
143+
{
144+
"description": "anything allowed with qux",
145+
"data": {
146+
"foo": "qux",
147+
"blah": ["some other property"],
148+
"more": "properties"
149+
},
150+
"valid": true
151+
},
152+
{
153+
"description": "quux is disallowed",
154+
"data": {
155+
"foo": "quux"
156+
},
111157
"valid": false
112158
}
113159
]

0 commit comments

Comments
 (0)