diff --git a/src/app/components/inputtextarea/inputtextarea.spec.ts b/src/app/components/inputtextarea/inputtextarea.spec.ts
index b3de182602e..5fa4e1394b9 100755
--- a/src/app/components/inputtextarea/inputtextarea.spec.ts
+++ b/src/app/components/inputtextarea/inputtextarea.spec.ts
@@ -3,6 +3,7 @@ import { By } from '@angular/platform-browser';
import { InputTextarea } from './inputtextarea';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Component, DebugElement } from '@angular/core';
+import e from 'express';
@Component({
template: ` `
@@ -13,7 +14,7 @@ class TestInputTextArea {
onResize(event) {}
}
-describe('InputTextarea', () => {
+fdescribe('InputTextarea', () => {
let fixture: ComponentFixture;
let component: TestInputTextArea;
beforeEach(() => {
@@ -38,12 +39,37 @@ describe('InputTextarea', () => {
const onResizeSpy = spyOn(component, 'onResize').and.callThrough();
const inputTextEl = fixture.debugElement.query(By.css('textarea'));
- inputTextEl.nativeElement.dispatchEvent(new Event('focus'));
+ inputTextEl.nativeElement.value = 'primeng';
+ inputTextEl.nativeElement.dispatchEvent(new Event('input'));
+ fixture.detectChanges();
+
+ inputTextEl.nativeElement.value = 'primeng rocks!';
+ inputTextEl.nativeElement.dispatchEvent(new Event('input'));
+ fixture.detectChanges();
+
+ expect(onResizeSpy).toHaveBeenCalledTimes(2);
+ });
+
+ it('should change autoResize and resize textarea', () => {
+ component.autoResize = true;
fixture.detectChanges();
- inputTextEl.nativeElement.dispatchEvent(new Event('blur'));
+ const onResizeSpy = spyOn(component, 'onResize').and.callThrough();
+ const inputTextEl = fixture.debugElement.query(By.css('textarea'));
+ const initialScrollHeight = inputTextEl.nativeElement.scrollHeight;
+
+ inputTextEl.nativeElement.value = 'primeng';
+ inputTextEl.nativeElement.dispatchEvent(new Event('input'));
+ fixture.detectChanges();
+
+ expect(inputTextEl.nativeElement.scrollHeight).toBeGreaterThan(initialScrollHeight);
+ const newScrollHeight = inputTextEl.nativeElement.scrollHeight;
+
+ inputTextEl.nativeElement.value = 'primeng rocks!';
+ inputTextEl.nativeElement.dispatchEvent(new Event('input'));
fixture.detectChanges();
+ expect(inputTextEl.nativeElement.scrollHeight).toBeGreaterThan(newScrollHeight);
expect(onResizeSpy).toHaveBeenCalledTimes(2);
});