diff options
author | Chi Cheng <cloudream@gmail.com> | 2008-08-19 05:54:49 +0000 |
---|---|---|
committer | Chi Cheng <cloudream@gmail.com> | 2008-08-19 05:54:49 +0000 |
commit | 1f6a9c9eda1cf26838cf3e7edf14830c7311ad1e (patch) | |
tree | 1de719e869eae1d41a6d858ee7c26d528e9ccf55 /tests/spinner.js | |
parent | f50d9f0a954db2c4e17380d16273388910188590 (diff) | |
download | jquery-ui-1f6a9c9eda1cf26838cf3e7edf14830c7311ad1e.tar.gz jquery-ui-1f6a9c9eda1cf26838cf3e7edf14830c7311ad1e.zip |
Spinner test: spin with auto-incremental stepping
Diffstat (limited to 'tests/spinner.js')
-rw-r--r-- | tests/spinner.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/spinner.js b/tests/spinner.js index ca664b2e2..4c0bf2b14 100644 --- a/tests/spinner.js +++ b/tests/spinner.js @@ -104,6 +104,29 @@ test("keydown on input with options", function() { });
+test("spin with auto-incremental stepping", function() {
+ expect(2);
+
+ el = $("#spin").spinner();
+
+ for ( var i = 1 ; i<=120 ; i++ ) {
+ el.simulate("keydown",{keyCode:$.simulate.VK_UP});
+ }
+
+ el.simulate("keyup",{keyCode:$.simulate.VK_UP});
+
+ equals(el.val(), 300, "keydown 120 times");
+
+ for ( var i = 1 ; i<=130 ; i++ ) {
+ el.simulate("keydown",{keyCode:$.simulate.VK_DOWN});
+ }
+
+ el.simulate("keyup",{keyCode:$.simulate.VK_DOWN});
+
+ equals(el.val(), -100, "keydown 130 times");
+
+});
+
test("mouse click on buttons", function() {
expect(4);
el = $("#spin").spinner();
|