@@ -141,6 +141,45 @@ describe('MatProgressBar', () => {
141
141
142
142
expect ( rect . getAttribute ( 'fill' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ a n o t h e r - f a k e - p a t h # .* [ ' " ] ? \) $ / ) ;
143
143
} ) ;
144
+
145
+ it ( 'should remove the `aria-valuenow` attribute in indeterminate mode' , ( ) => {
146
+ const fixture = createComponent ( BasicProgressBar ) ;
147
+ fixture . detectChanges ( ) ;
148
+
149
+ const progressElement = fixture . debugElement . query ( By . css ( 'mat-progress-bar' ) ) ;
150
+ const progressComponent = progressElement . componentInstance ;
151
+
152
+ progressComponent . mode = 'determinate' ;
153
+ progressComponent . value = 50 ;
154
+ fixture . detectChanges ( ) ;
155
+
156
+ expect ( progressElement . nativeElement . getAttribute ( 'aria-valuenow' ) ) . toBe ( '50' ) ;
157
+
158
+ progressComponent . mode = 'indeterminate' ;
159
+ fixture . detectChanges ( ) ;
160
+
161
+ expect ( progressElement . nativeElement . hasAttribute ( 'aria-valuenow' ) ) . toBe ( false ) ;
162
+ } ) ;
163
+
164
+ it ( 'should remove the `aria-valuenow` attribute in query mode' , ( ) => {
165
+ const fixture = createComponent ( BasicProgressBar ) ;
166
+ fixture . detectChanges ( ) ;
167
+
168
+ const progressElement = fixture . debugElement . query ( By . css ( 'mat-progress-bar' ) ) ;
169
+ const progressComponent = progressElement . componentInstance ;
170
+
171
+ progressComponent . mode = 'determinate' ;
172
+ progressComponent . value = 50 ;
173
+ fixture . detectChanges ( ) ;
174
+
175
+ expect ( progressElement . nativeElement . getAttribute ( 'aria-valuenow' ) ) . toBe ( '50' ) ;
176
+
177
+ progressComponent . mode = 'query' ;
178
+ fixture . detectChanges ( ) ;
179
+
180
+ expect ( progressElement . nativeElement . hasAttribute ( 'aria-valuenow' ) ) . toBe ( false ) ;
181
+ } ) ;
182
+
144
183
} ) ;
145
184
146
185
describe ( 'animation trigger on determinate setting' , ( ) => {
0 commit comments