File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -263,4 +263,31 @@ describe('FormBuilder', () => {
263
263
. map ( ( error ) => error . text ( ) ) ;
264
264
expect ( errors ) . toEqual ( [ ] ) ;
265
265
} ) ;
266
+
267
+ it ( 'validates additionalProperties as a valid property' , ( ) => {
268
+ const jsonSchema = {
269
+ $schema : `http://json-schema.org/draft-07/schema#` ,
270
+ properties : { } ,
271
+ required : [ ] ,
272
+ additionalProperties : false ,
273
+ } ;
274
+
275
+ const props = {
276
+ schema : JSON . stringify ( jsonSchema ) ,
277
+ uiSchema : '{}' ,
278
+ onChange : jest . fn ( ( ) => { } ) ,
279
+ mods : { } ,
280
+ className : 'my-form-builder' ,
281
+ } ;
282
+
283
+ const div = document . createElement ( 'div' ) ;
284
+ document . body . appendChild ( div ) ;
285
+ const wrapper = mount ( < FormBuilder { ...props } /> , { attachTo : div } ) ;
286
+ const errors = wrapper
287
+ . find ( '.alert-warning' )
288
+ . first ( )
289
+ . find ( 'li' )
290
+ . map ( ( error ) => error . text ( ) ) ;
291
+ expect ( errors ) . toEqual ( [ ] ) ;
292
+ } ) ;
266
293
} ) ;
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ const supportedPropertyParameters = new Set([
146
146
'$id' ,
147
147
'$schema' ,
148
148
'meta' ,
149
+ 'additionalProperties' ,
149
150
] ) ;
150
151
151
152
const supportedUiParameters = new Set ( [
You can’t perform that action at this time.
0 commit comments