|
1 | 1 | import { Component, ContentChildren, DebugElement, ViewChild } from "@angular/core";
|
2 |
| -import { async, ComponentFixture, TestBed} from "@angular/core/testing"; |
| 2 | +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; |
3 | 3 | import { By } from "@angular/platform-browser";
|
4 | 4 | import { IgxComboComponent, IgxComboModule } from "./combo.component";
|
5 | 5 |
|
| 6 | +const selectedItemClass = ".igx-combo__item--selected"; |
| 7 | +const citiesData = [ |
| 8 | + "New York", |
| 9 | + "Sofia", |
| 10 | + "Istanbul", |
| 11 | + "Paris", |
| 12 | + "Hamburg", |
| 13 | + "Berlin", |
| 14 | + "London", |
| 15 | + "Oslo", |
| 16 | + "Los Angeles", |
| 17 | + "Rome", |
| 18 | + "Madrid", |
| 19 | + "Ottawa", |
| 20 | + "Prague"]; |
| 21 | +const employeeData = [ |
| 22 | + { ID: 1, Name: "Casey Houston", JobTitle: "Vice President", HireDate: "2017-06-19T11:43:07.714Z" }, |
| 23 | + { ID: 2, Name: "Gilberto Todd", JobTitle: "Director", HireDate: "2015-12-18T11:23:17.714Z" }, |
| 24 | + { ID: 3, Name: "Tanya Bennett", JobTitle: "Director", HireDate: "2005-11-18T11:23:17.714Z" }, |
| 25 | + { ID: 4, Name: "Jack Simon", JobTitle: "Software Developer", HireDate: "2008-12-18T11:23:17.714Z" }, |
| 26 | + { ID: 5, Name: "Celia Martinez", JobTitle: "Senior Software Developer", HireDate: "2007-12-19T11:23:17.714Z" }, |
| 27 | + { ID: 6, Name: "Erma Walsh", JobTitle: "CEO", HireDate: "2016-12-18T11:23:17.714Z" }, |
| 28 | + { ID: 7, Name: "Debra Morton", JobTitle: "Associate Software Developer", HireDate: "2005-11-19T11:23:17.714Z" }, |
| 29 | + { ID: 8, Name: "Erika Wells", JobTitle: "Software Development Team Lead", HireDate: "2005-10-14T11:23:17.714Z" }, |
| 30 | + { ID: 9, Name: "Leslie Hansen", JobTitle: "Associate Software Developer", HireDate: "2013-10-10T11:23:17.714Z" }, |
| 31 | + { ID: 10, Name: "Eduardo Ramirez", JobTitle: "Manager", HireDate: "2011-11-28T11:23:17.714Z" } |
| 32 | +]; |
| 33 | + |
6 | 34 | describe("Combo", () => {
|
7 | 35 | beforeEach(async(() => {
|
8 | 36 | TestBed.configureTestingModule({
|
9 |
| - declarations: [/*BasicComboComponent*/], |
| 37 | + declarations: [IgxComboTestComponent], |
10 | 38 | imports: [IgxComboModule]
|
11 | 39 | }).compileComponents();
|
12 | 40 | }));
|
13 | 41 |
|
14 | 42 | // General
|
15 | 43 | it("Combo's input textbox should be read-only", () => {
|
16 |
| - // TO DO |
| 44 | + const fixture = TestBed.createComponent(IgxComboTestComponent); |
| 45 | + fixture.detectChanges(); |
| 46 | + const inputElement = fixture.debugElement.query(By.css("input[name=\"comboButton\"]")); |
17 | 47 | });
|
18 | 48 |
|
19 | 49 | // Rendering
|
@@ -160,3 +190,20 @@ describe("Combo", () => {
|
160 | 190 | // TO DO
|
161 | 191 | });
|
162 | 192 | });
|
| 193 | + |
| 194 | +@Component({ |
| 195 | + template: ` |
| 196 | + <igx-combo #combo |
| 197 | + [data]="citiesData" |
| 198 | + [width]="'800px'" |
| 199 | + [height]="'600px'" |
| 200 | +> |
| 201 | +</igx-combo> |
| 202 | +` |
| 203 | +}) |
| 204 | +class IgxComboTestComponent { |
| 205 | + |
| 206 | + @ViewChild("combo", { read: IgxComboComponent}) |
| 207 | + public dropdown: IgxComboComponent; |
| 208 | + |
| 209 | +} |
0 commit comments