Skip to content

Commit

Permalink
test(dropdown): Add verification for disabled items #984
Browse files Browse the repository at this point in the history
  • Loading branch information
dafo committed May 18, 2018
1 parent a37fe1f commit 5f61524
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/drop-down/drop-down.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ describe("IgxDropDown ", () => {
});
});

it("End key should select the last enabled item", () => {
fit("End key should select the last enabled item", () => {
const fixture = TestBed.createComponent(IgxDropDownTestDisabledComponent);
fixture.detectChanges();
const button = fixture.debugElement.query(By.css("button")).nativeElement;
Expand All @@ -485,6 +485,13 @@ describe("IgxDropDown ", () => {
expect(list.items[4].isSelected).toBeTruthy();
currentItem.triggerEventHandler("keydown.End", jasmine.createSpyObj("mockEvt", ["stopPropagation", "preventDefault"]));
return fixture.whenStable();
}).then(() => {
fixture.detectChanges();
expect(listItems[11].isFocused).toBeTruthy();
const currentItem = fixture.debugElement.query(By.css("." + CSS_CLASS_FOCUSED));
expect(currentItem.componentInstance.index).toEqual(11);
currentItem.triggerEventHandler("keydown.ArrowDown", jasmine.createSpyObj("mockEvt", ["stopPropagation", "preventDefault"]));
return fixture.whenStable();
}).then(() => {
fixture.detectChanges();
expect(listItems[11].isFocused).toBeTruthy();
Expand Down

0 comments on commit 5f61524

Please sign in to comment.