diff --git a/tests/unit/textinput/index.html b/tests/unit/textinput/index.html index 2c720209..5785181c 100644 --- a/tests/unit/textinput/index.html +++ b/tests/unit/textinput/index.html @@ -43,6 +43,9 @@ Place holder text Place holder text + + diff --git a/tests/unit/textinput/textinput_core.js b/tests/unit/textinput/textinput_core.js index dd9021e5..ffc292b1 100644 --- a/tests/unit/textinput/textinput_core.js +++ b/tests/unit/textinput/textinput_core.js @@ -24,4 +24,19 @@ start(); }, 400); }); + + asyncTest( "textarea should autogrow when text is added via the keyboard", function() { + var test = $( "#keyup-autogrow" ), + originalHeight = test[0].clientHeight; + + test.keyup(function() { + setTimeout(function() { + ok( test[0].clientHeight > originalHeight, "the height is greater than original with no content" ); + ok( test[0].clientHeight > 100, "autogrow text area's height is greater any style/padding"); + start(); + }, 400) + }); + + test.val("foo\n\n\n\n\n\n\n\n\n\n\n\n\n\n").trigger("keyup"); + }); })(jQuery); \ No newline at end of file