@@ -56,11 +56,6 @@ test('#componentDidMount does not throw errow if props.id is passed', () => {
56
56
shallow ( < Input id = '123-best-id' /> ) ;
57
57
} ) ;
58
58
59
- test ( '#componentDidMount does not throw errow if validation attr is updated' , ( ) => {
60
- const wrapper = shallow ( < Input /> ) ;
61
- wrapper . setProps ( { required : true } ) ;
62
- } ) ;
63
-
64
59
test ( '#componentDidMount should not call any method if disabled and id do not exist' , ( ) => {
65
60
const setDisabled = td . func ( ) ;
66
61
const setInputId = td . func ( ) ;
@@ -73,14 +68,19 @@ test('#componentDidMount should not call any method if disabled and id do not ex
73
68
td . verify ( setDisabled ( td . matchers . isA ( Boolean ) ) , { times : 0 } ) ;
74
69
} ) ;
75
70
76
- test ( '#componentWillReceiveProps calls handleValidationAttributeMutation_ when ' +
71
+ test ( 'change to minLength calls handleValidationAttributeChange' , ( ) => {
72
+ const handleValidationAttributeChange = td . func ( ) ;
73
+ const wrapper = shallow ( < Input foundation = { { handleValidationAttributeChange} } /> ) ;
74
+ wrapper . setProps ( { minLength : 20 } ) ;
75
+ td . verify ( handleValidationAttributeChange ( [ 'minlength' ] ) , { times : 1 } ) ;
76
+ } ) ;
77
+
78
+ test ( '#componentWillReceiveProps calls handleValidationAttributeChange when ' +
77
79
'a whitelisted attr updates' , ( ) => {
78
- const foundation = { handleValidationAttributeMutation_ : td . func ( ) } ;
79
- const wrapper = shallow ( < Input foundation = { foundation } /> ) ;
80
+ const handleValidationAttributeChange = td . func ( ) ;
81
+ const wrapper = shallow ( < Input foundation = { { handleValidationAttributeChange } } /> ) ;
80
82
wrapper . setProps ( { required : true } ) ;
81
- td . verify ( foundation . handleValidationAttributeMutation_ ( [ {
82
- attributeName : 'pattern' ,
83
- } ] ) , { times : 1 } ) ;
83
+ td . verify ( handleValidationAttributeChange ( [ 'required' ] ) , { times : 1 } ) ;
84
84
} ) ;
85
85
86
86
test ( '#componentWillReceiveProps calls setDisabled and foundation.setDisabled when ' +
0 commit comments