This repository was archived by the owner on Aug 23, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -747,6 +747,24 @@ function createControlClass(s = defaultStrategy) {
747
747
748
748
DefaultConnectedControl . text = DefaultConnectedControlText ;
749
749
750
+ class DefaultConnectedControlPassword extends DefaultConnectedControl {
751
+ render ( ) {
752
+ return (
753
+ < ConnectedControl
754
+ component = "input"
755
+ { ...this . props }
756
+ mapProps = { {
757
+ ...controlPropsMap . text ,
758
+ type : this . props . type || 'password' ,
759
+ ...this . props . mapProps ,
760
+ } }
761
+ />
762
+ ) ;
763
+ }
764
+ }
765
+
766
+ DefaultConnectedControl . password = DefaultConnectedControlPassword ;
767
+
750
768
class DefaultConnectedControlTextArea extends DefaultConnectedControl {
751
769
render ( ) {
752
770
return (
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ Object.keys(testContexts).forEach((testKey) => {
153
153
const textFieldElements = [
154
154
[ '' ] ,
155
155
[ 'text' ] ,
156
+ [ 'password' ] ,
156
157
[ 'text' , 'email' ] ,
157
158
[ 'input' , 'text' ] ,
158
159
[ 'input' , 'password' ] ,
@@ -220,9 +221,9 @@ Object.keys(testContexts).forEach((testKey) => {
220
221
'testing again' ) ;
221
222
} ) ;
222
223
223
- if ( controlType === 'text' && ! type ) {
224
- it ( ' should have a type="text"' , ( ) => {
225
- assert . equal ( node . getAttribute ( 'type' ) , 'text' ) ;
224
+ if ( ( controlType === 'text' || controlType === 'password' ) && ! type ) {
225
+ it ( ` should have a type="${ controlType } "` , ( ) => {
226
+ assert . equal ( node . getAttribute ( 'type' ) , controlType ) ;
226
227
} ) ;
227
228
} else {
228
229
it ( 'should have the appropriate type attribute' , ( ) => {
You can’t perform that action at this time.
0 commit comments