@@ -179,31 +179,17 @@ describe('MatSelect', () => {
179
179
fixture . detectChanges ( ) ;
180
180
181
181
const labelId = fixture . nativeElement . querySelector ( 'label' ) . id ;
182
- const valueId = fixture . nativeElement . querySelector ( '.mat-mdc-select-value' ) . id ;
183
182
184
- expect ( select . getAttribute ( 'aria-labelledby' ) ) . toBe ( `${ labelId } ${ valueId } myLabelId` ) ;
183
+ expect ( select . getAttribute ( 'aria-labelledby' ) ) . toBe ( `${ labelId } myLabelId` ) ;
185
184
} ) ;
186
185
187
- it ( 'should set aria-labelledby to the value and label IDs ' , ( ) => {
186
+ it ( 'should set aria-labelledby to the label ID ' , ( ) => {
188
187
fixture . detectChanges ( ) ;
189
188
190
189
const labelId = fixture . nativeElement . querySelector ( 'label' ) . id ;
191
- const valueId = fixture . nativeElement . querySelector ( '.mat-mdc-select-value' ) . id ;
192
- expect ( select . getAttribute ( 'aria-labelledby' ) ) . toBe ( `${ labelId } ${ valueId } ` ) ;
190
+ expect ( select . getAttribute ( 'aria-labelledby' ) ) . toBe ( labelId ) ;
193
191
} ) ;
194
192
195
- it ( 'should trim the trigger aria-labelledby when there is no label' , fakeAsync ( ( ) => {
196
- fixture . componentInstance . hasLabel = false ;
197
- fixture . changeDetectorRef . markForCheck ( ) ;
198
- fixture . detectChanges ( ) ;
199
- flush ( ) ;
200
- fixture . detectChanges ( ) ;
201
-
202
- // Note that we assert that there are no spaces around the value.
203
- const valueId = fixture . nativeElement . querySelector ( '.mat-mdc-select-value' ) . id ;
204
- expect ( select . getAttribute ( 'aria-labelledby' ) ) . toBe ( `${ valueId } ` ) ;
205
- } ) ) ;
206
-
207
193
it ( 'should set the tabindex of the select to 0 by default' , ( ) => {
208
194
expect ( select . getAttribute ( 'tabindex' ) ) . toEqual ( '0' ) ;
209
195
} ) ;
@@ -298,17 +284,6 @@ describe('MatSelect', () => {
298
284
expect ( select . getAttribute ( 'tabindex' ) ) . toEqual ( '0' ) ;
299
285
} ) ;
300
286
301
- it ( 'should set `aria-labelledby` to the value ID if there is no form field' , ( ) => {
302
- fixture . destroy ( ) ;
303
-
304
- const labelFixture = TestBed . createComponent ( SelectWithChangeEvent ) ;
305
- labelFixture . detectChanges ( ) ;
306
- select = labelFixture . debugElement . query ( By . css ( 'mat-select' ) ) ! . nativeElement ;
307
- const valueId = labelFixture . nativeElement . querySelector ( '.mat-mdc-select-value' ) . id ;
308
-
309
- expect ( select . getAttribute ( 'aria-labelledby' ) ?. trim ( ) ) . toBe ( valueId ) ;
310
- } ) ;
311
-
312
287
it ( 'should select options via the UP/DOWN arrow keys on a closed select' , fakeAsync ( ( ) => {
313
288
const formControl = fixture . componentInstance . control ;
314
289
const options = fixture . componentInstance . options . toArray ( ) ;
0 commit comments