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