File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 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):
5555 'validator' : 'plotly_figure'
5656 }
5757 })
58+ self .options_validator = make_validator ({
59+ 'options' : {
60+ 'validator' : 'options_with_unique_values'
61+ }
62+ })
5863
5964 def test_component_in_initial_layout_is_validated (self ):
6065 app = dash .Dash (__name__ )
@@ -486,3 +491,17 @@ def test_figure_validation(self):
486491 self .assertFalse (self .figure_validator .validate ({
487492 'figure' : None
488493 }))
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