From 50204053bcf0da7af040a25a93c094ad83c4c692 Mon Sep 17 00:00:00 2001 From: John Bender Date: Wed, 9 Nov 2011 11:32:39 -0800 Subject: [PATCH] test for page load text area autogrow --- tests/unit/textinput/external.html | 38 ++++++++++++++++++++++++++ tests/unit/textinput/index.html | 1 + tests/unit/textinput/textinput_core.js | 19 +++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 tests/unit/textinput/external.html diff --git a/tests/unit/textinput/external.html b/tests/unit/textinput/external.html new file mode 100644 index 00000000..2d10dd62 --- /dev/null +++ b/tests/unit/textinput/external.html @@ -0,0 +1,38 @@ + + + + + +
+ +
+ + diff --git a/tests/unit/textinput/index.html b/tests/unit/textinput/index.html index 738f2f07..1e6add37 100644 --- a/tests/unit/textinput/index.html +++ b/tests/unit/textinput/index.html @@ -46,6 +46,7 @@ + external diff --git a/tests/unit/textinput/textinput_core.js b/tests/unit/textinput/textinput_core.js index 106e3975..41381f51 100644 --- a/tests/unit/textinput/textinput_core.js +++ b/tests/unit/textinput/textinput_core.js @@ -39,4 +39,23 @@ test.val("foo\n\n\n\n\n\n\n\n\n\n\n\n\n\n").trigger("keyup"); }); + + asyncTest( "text area should auto grow when the parent page is loaded via ajax", function() { + $.testHelper.pageSequence([ + function() { + $("#external").click(); + }, + + function() { + setTimeout(function() { + ok($.mobile.activePage.find( "textarea" )[0].clientHeight > 100, "text area's height has grown"); + window.history.back(); + }, 1000); + }, + + function() { + start(); + } + ]); + }); })(jQuery); \ No newline at end of file