|
1 | 1 | import { IgxInputState } from './../directives/input/input.directive'; |
2 | | -import { Component, ViewChild, DebugElement, OnInit, ViewChildren, QueryList } from '@angular/core'; |
| 2 | +import { Component, ViewChild, DebugElement, OnInit, ViewChildren, QueryList, ElementRef } from '@angular/core'; |
3 | 3 | import { async, TestBed, tick, fakeAsync } from '@angular/core/testing'; |
4 | 4 | import { FormsModule, FormGroup, FormBuilder, FormControl, Validators, ReactiveFormsModule, NgForm, NgControl } from '@angular/forms'; |
5 | 5 | import { By } from '@angular/platform-browser'; |
@@ -381,8 +381,11 @@ describe('igxSelect', () => { |
381 | 381 | const dropdownListElement = fixture.debugElement.query(By.css('.' + CSS_CLASS_DROPDOWN_LIST_SCROLL)); |
382 | 382 | const dropdownWrapper = fixture.debugElement.query(By.css('.' + CSS_CLASS_DROPDOWN_LIST)); |
383 | 383 | const toggleBtn = fixture.debugElement.query(By.css('.' + CSS_CLASS_TOGGLE_BUTTON)); |
| 384 | + const labelID = fixture.componentInstance.label1.nativeElement.getAttribute('id'); |
384 | 385 | expect(inputElement.nativeElement.getAttribute('role')).toEqual('combobox'); |
385 | 386 | expect(inputElement.nativeElement.getAttribute('aria-haspopup')).toEqual('listbox'); |
| 387 | + expect(inputElement.nativeElement.getAttribute('aria-labelledby')).toEqual(labelID); |
| 388 | + expect(dropdownListElement.nativeElement.getAttribute('aria-labelledby')).toEqual(labelID); |
386 | 389 | expect(inputElement.nativeElement.getAttribute('aria-owns')).toEqual(select.listId); |
387 | 390 | expect(inputElement.nativeElement.getAttribute('aria-expanded')).toEqual('false'); |
388 | 391 | expect(toggleBtn.nativeElement.getAttribute('aria-hidden')).toEqual('true'); |
@@ -2632,15 +2635,18 @@ describe('igxSelect ControlValueAccessor Unit', () => { |
2632 | 2635 | @Component({ |
2633 | 2636 | template: ` |
2634 | 2637 | <igx-select #select [width]="'300px'" [height]="'200px'" [placeholder]="'Choose a city'" [(ngModel)]="value"> |
2635 | | - <igx-select-item *ngFor="let item of items" [value]="item" [text]="item"> |
2636 | | - {{ item }} {{'©'}} |
2637 | | - </igx-select-item> |
| 2638 | + <label igxLabel #simpleLabel>Select Simple Component</label> |
| 2639 | + <igx-select-item *ngFor="let item of items" [value]="item" [text]="item"> |
| 2640 | + {{ item }} {{'©'}} |
| 2641 | + </igx-select-item> |
2638 | 2642 | </igx-select> |
2639 | 2643 | ` |
2640 | 2644 | }) |
2641 | 2645 | class IgxSelectSimpleComponent { |
2642 | 2646 | @ViewChild('select', { read: IgxSelectComponent, static: true }) |
2643 | 2647 | public select: IgxSelectComponent; |
| 2648 | + @ViewChild('simpleLabel', { read: ElementRef, static: true }) |
| 2649 | + public label1: ElementRef; |
2644 | 2650 | public items: string[] = [ |
2645 | 2651 | 'New York', |
2646 | 2652 | 'Sofia', |
|
0 commit comments