mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
test for page load text area autogrow
This commit is contained in:
parent
3f52c482d0
commit
50204053bc
3 changed files with 58 additions and 0 deletions
38
tests/unit/textinput/external.html
Normal file
38
tests/unit/textinput/external.html
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<div data-nstest-role="page" id="foo">
|
||||
<textarea id="page-load-autogrow">
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
Place holder text
|
||||
</textarea>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
<textarea id="keyup-autogrow">
|
||||
</textarea>
|
||||
<a href="external.html" id="external">external</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
Loading…
Reference in a new issue