diff --git a/src/drop-down/drop-down.component.spec.ts b/src/drop-down/drop-down.component.spec.ts new file mode 100644 index 00000000000..783a38ca7fe --- /dev/null +++ b/src/drop-down/drop-down.component.spec.ts @@ -0,0 +1,46 @@ +import { Component, ContentChildren, ViewChild } from "@angular/core"; +import { async, TestBed } from "@angular/core/testing"; +import { By } from "@angular/platform-browser"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { IgxToggleDirective, IgxToggleModule } from "../directives/toggle/toggle.directive"; +import { IgxDropDownComponent, IgxDropDownModule } from "./drop-down.component"; + +describe("IgxDropDown ", () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + IgxDropDownTestComponent + ], + imports: [IgxDropDownModule, BrowserAnimationsModule] + }) + .compileComponents(); + })); + + it("should initialize igx-drop-down", () => { + const fixture = TestBed.createComponent(IgxDropDownTestComponent); + const list = fixture.componentInstance.items; + expect(list).toBeDefined(); + expect(list.length).toEqual(4); + }); +}); + +@Component({ + template: ` + + + + {{ item.field }} + + +
+ ` +}) +export class IgxDropDownTestComponent { + public items: any[] = [ + { field: "Cables" }, + { field: "Switches", disabled: true, header: true }, + { field: "Switches", disabled: false }, + { field: "Batteries", disabled: true } + ]; + @ViewChild(IgxDropDownComponent) public igxDropDown: IgxDropDownComponent; +}