|
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'); |
@@ -2658,15 +2661,18 @@ describe('igxSelect ControlValueAccessor Unit', () => { |
2658 | 2661 | @Component({ |
2659 | 2662 | template: ` |
2660 | 2663 | <igx-select #select [width]="'300px'" [height]="'200px'" [placeholder]="'Choose a city'" [(ngModel)]="value"> |
2661 | | - <igx-select-item *ngFor="let item of items" [value]="item" [text]="item"> |
2662 | | - {{ item }} {{'©'}} |
2663 | | - </igx-select-item> |
| 2664 | + <label igxLabel #simpleLabel>Select Simple Component</label> |
| 2665 | + <igx-select-item *ngFor="let item of items" [value]="item" [text]="item"> |
| 2666 | + {{ item }} {{'©'}} |
| 2667 | + </igx-select-item> |
2664 | 2668 | </igx-select> |
2665 | 2669 | ` |
2666 | 2670 | }) |
2667 | 2671 | class IgxSelectSimpleComponent { |
2668 | 2672 | @ViewChild('select', { read: IgxSelectComponent, static: true }) |
2669 | 2673 | public select: IgxSelectComponent; |
| 2674 | + @ViewChild('simpleLabel', { read: ElementRef, static: true }) |
| 2675 | + public label1: ElementRef; |
2670 | 2676 | public items: string[] = [ |
2671 | 2677 | 'New York', |
2672 | 2678 | 'Sofia', |
|
0 commit comments