File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ def make_validator(schema):
55
55
'validator' : 'plotly_figure'
56
56
}
57
57
})
58
+ self .options_validator = make_validator ({
59
+ 'options' : {
60
+ 'validator' : 'options_with_unique_values'
61
+ }
62
+ })
58
63
59
64
def test_component_in_initial_layout_is_validated (self ):
60
65
app = dash .Dash (__name__ )
@@ -486,3 +491,17 @@ def test_figure_validation(self):
486
491
self .assertFalse (self .figure_validator .validate ({
487
492
'figure' : None
488
493
}))
494
+
495
+ def test_options_validation (self ):
496
+ self .assertFalse (self .options_validator .validate ({
497
+ 'options' : [
498
+ {'value' : 'value1' , 'label' : 'label1' },
499
+ {'value' : 'value1' , 'label' : 'label1' }
500
+ ]
501
+ }))
502
+ self .assertTrue (self .options_validator .validate ({
503
+ 'options' : [
504
+ {'value' : 'value1' , 'label' : 'label1' },
505
+ {'value' : 'value2' , 'label' : 'label2' }
506
+ ]
507
+ }))
You can’t perform that action at this time.
0 commit comments