Skip to content

Commit

Permalink
test(igx-drop-down): refactor initial test, #984
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorSlavov committed May 3, 2018
1 parent 324db30 commit d3f0d18
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/drop-down/drop-down.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, ContentChildren, ViewChild } from "@angular/core";
import { async, TestBed } from "@angular/core/testing";
import { By } from "@angular/platform-browser";
import { BrowserAnimationsModule, NoopAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { IgxToggleActionDirective, IgxToggleDirective, IgxToggleModule } from "../directives/toggle/toggle.directive";
import { IgxDropDownItemComponent } from "./drop-down-item.component";
import { IgxDropDownComponent, IgxDropDownModule } from "./drop-down.component";
Expand All @@ -12,7 +12,7 @@ describe("IgxDropDown ", () => {
declarations: [
IgxDropDownTestComponent
],
imports: [IgxDropDownModule, BrowserAnimationsModule, NoopAnimationsModule, IgxToggleModule]
imports: [IgxDropDownModule, BrowserAnimationsModule, IgxToggleModule]
})
.compileComponents();
}));
Expand All @@ -35,7 +35,10 @@ describe("IgxDropDown ", () => {
// tslint:disable-next-line:no-debugger
debugger;
button.click();
expect(item.isFocused).toBe(true);
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(item.isFocused).toBe(true);
});
});

xit("should select item by SPACE/ENTER", () => {
Expand Down Expand Up @@ -79,7 +82,8 @@ describe("IgxDropDown ", () => {
})
class IgxDropDownTestComponent {

@ViewChild(IgxDropDownComponent) public dropdown: IgxDropDownComponent;
@ViewChild(IgxDropDownComponent, {read: IgxDropDownComponent})
public dropdown: IgxDropDownComponent;

public items: any[] = [
{ field: "Nav1" },
Expand Down

0 comments on commit d3f0d18

Please sign in to comment.