This repository was archived by the owner on Jun 26, 2020. It is now read-only.
File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,8 @@ export default class LabeledInputView extends View {
210
210
bind . if ( 'errorText' , 'ck-labeled-input__status_error' ) ,
211
211
bind . if ( '_statusText' , 'ck-hidden' , value => ! value )
212
212
] ,
213
- id : statusUid
213
+ id : statusUid ,
214
+ role : bind . if ( 'errorText' , 'alert' )
214
215
} ,
215
216
children : [
216
217
{
Original file line number Diff line number Diff line change @@ -93,11 +93,13 @@ describe( 'LabeledInputView', () => {
93
93
view . errorText = '' ;
94
94
expect ( statusElement . classList . contains ( 'ck-hidden' ) ) . to . be . true ;
95
95
expect ( statusElement . classList . contains ( 'ck-labeled-input__status_error' ) ) . to . be . false ;
96
+ expect ( statusElement . hasAttribute ( 'role' ) ) . to . be . false ;
96
97
expect ( statusElement . innerHTML ) . to . equal ( '' ) ;
97
98
98
99
view . errorText = 'foo' ;
99
100
expect ( statusElement . classList . contains ( 'ck-hidden' ) ) . to . be . false ;
100
101
expect ( statusElement . classList . contains ( 'ck-labeled-input__status_error' ) ) . to . be . true ;
102
+ expect ( statusElement . getAttribute ( 'role' ) ) . to . equal ( 'alert' ) ;
101
103
expect ( statusElement . innerHTML ) . to . equal ( 'foo' ) ;
102
104
} ) ;
103
105
@@ -107,11 +109,13 @@ describe( 'LabeledInputView', () => {
107
109
view . infoText = '' ;
108
110
expect ( statusElement . classList . contains ( 'ck-hidden' ) ) . to . be . true ;
109
111
expect ( statusElement . classList . contains ( 'ck-labeled-input__status_error' ) ) . to . be . false ;
112
+ expect ( statusElement . hasAttribute ( 'role' ) ) . to . be . false ;
110
113
expect ( statusElement . innerHTML ) . to . equal ( '' ) ;
111
114
112
115
view . infoText = 'foo' ;
113
116
expect ( statusElement . classList . contains ( 'ck-hidden' ) ) . to . be . false ;
114
117
expect ( statusElement . classList . contains ( 'ck-labeled-input__status_error' ) ) . to . be . false ;
118
+ expect ( statusElement . hasAttribute ( 'role' ) ) . to . be . false ;
115
119
expect ( statusElement . innerHTML ) . to . equal ( 'foo' ) ;
116
120
} ) ;
117
121
} ) ;
You can’t perform that action at this time.
0 commit comments