Skip to content

Commit

Permalink
test(igx-autocomplete): aria and attributes #3585
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipata committed Jan 25, 2019
1 parent 71ce2e4 commit a7c47fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,19 @@ describe('IgxAutocomplete', () => {
expect(dropDownAny.scrollContainer.getBoundingClientRect().width)
.toEqual(group.element.nativeElement.getBoundingClientRect().width);
}));
it('Aria', fakeAsync(() => {}));
it('Aria and attributes', fakeAsync(() => {
expect(input.nativeElement.attributes['autocomplete'].value).toMatch('off');
expect(input.nativeElement.attributes['role'].value).toMatch('combobox');
expect(input.nativeElement.attributes['aria-haspopup'].value).toMatch('listbox');
expect(input.nativeElement.attributes['aria-owns'].value).toMatch(dropDown.id);
expect(input.nativeElement.attributes['aria-expanded'].value).toMatch('false');
UIInteractions.sendInput(input, 's', fixture);
fixture.detectChanges();
tick();
expect(input.nativeElement.attributes['aria-expanded'].value).toMatch('true');
this.dropDown.close();
}));
it('ReactiveForm', fakeAsync(() => {}));
it('On HTML input', fakeAsync(() => {}));
it('On textarea', fakeAsync(() => {}));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class IgxAutocompleteDirective extends IgxDropDownItemNavigationDirective
*/
@HostBinding('attr.aria-owns')
public get ariaOwns() {
return this.id;
return this.dropDown.id;
}

@HostListener('input', ['$event'])
Expand Down

0 comments on commit a7c47fe

Please sign in to comment.