From d8d845511f0f3dacd116b6e5745cecc85fa574d9 Mon Sep 17 00:00:00 2001 From: AMarinov Date: Tue, 8 May 2018 16:46:30 +0300 Subject: [PATCH] chore(dropdown): Adding height/width tests #984 --- src/drop-down/drop-down.component.spec.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/drop-down/drop-down.component.spec.ts b/src/drop-down/drop-down.component.spec.ts index f5a5724867c..174b9421933 100644 --- a/src/drop-down/drop-down.component.spec.ts +++ b/src/drop-down/drop-down.component.spec.ts @@ -517,6 +517,26 @@ fdescribe("IgxDropDown ", () => { expect(currentItem.componentInstance.index).toEqual(1); }); }); + + it("Change width/height at runtime", () => { + 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); + fixture.componentInstance.dropdownDisabled.width = "80%"; + fixture.componentInstance.dropdownDisabled.height = "400px"; + button.click(); + fixture.whenStable().then(() => { + fixture.detectChanges(); + // tslint:disable-next-line:no-debugger + debugger; + expect(fixture.componentInstance.dropdownDisabled.height).toEqual("400px"); + expect(fixture.componentInstance.dropdownDisabled.width).toEqual("80%"); + }); + }); }); @Component({