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