diff --git a/src/drop-down/drop-down.component.spec.ts b/src/drop-down/drop-down.component.spec.ts index fac5d4aa730..6818f12a273 100644 --- a/src/drop-down/drop-down.component.spec.ts +++ b/src/drop-down/drop-down.component.spec.ts @@ -11,7 +11,7 @@ const CSS_CLASS_SELECTED = "igx-drop-down__item--selected"; const CSS_CLASS_DISABLED = "igx-drop-down__item--disabled"; const CSS_CLASS_HEADER = "igx-drop-down__header"; -fdescribe("IgxDropDown ", () => { +describe("IgxDropDown ", () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ @@ -529,6 +529,23 @@ fdescribe("IgxDropDown ", () => { }); }); + it("Disabled items cannot be selected", () => { + const fixture = TestBed.createComponent(IgxDropDownTestDisabledComponent); + fixture.detectChanges(); + const button = fixture.debugElement.query(By.css("button")).nativeElement; + const list = fixture.componentInstance.dropdownDisabled; + const listItems = list.items; + expect(list).toBeDefined(); + expect(list.items.length).toEqual(13); + list.setSelectedItem(0); + button.click(); + fixture.whenStable().then(() => { + fixture.detectChanges(); + expect(list.items[0].isSelected).toEqual(false); + button.click(); + }); + }); + it("Clicking a disabled item is not moving the focus", () => { const fixture = TestBed.createComponent(IgxDropDownTestDisabledComponent); fixture.detectChanges();